/* Chem.net — Chempages editorial (aligned with aaa.html: teal + gold, paper surfaces) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --gold: #c9a227;
  --gold-soft: #e8d48a;
  --bg-page: #f3f5f7;
  --bg-white: #fffdf9;
  --bg-muted: rgba(232, 212, 168, 0.22);
  --border: rgba(12, 21, 32, 0.14);
  /* Mobile nav dashed rules: avoid color-mix() for older iOS Safari */
  --nav-mobile-dash: rgba(12, 21, 32, 0.28);
  --text: #0c1520;
  --text-muted: #3d4e5f;
  --text-soft: #5c6b7a;
  --accent: #0d6b7a;
  --accent-deep: #084854;
  --accent-hover: #0a5c6a;
  --accent-mid: #0f7d8f;
  --accent-soft: rgba(13, 107, 122, 0.14);
  --accent-ring: rgba(13, 107, 122, 0.38);
  --header-bg: rgba(255, 253, 249, 0.92);
  --surface-hover: rgba(13, 107, 122, 0.1);
  --surface-active: rgba(13, 107, 122, 0.2);
  --radius: 0.875rem;
  --radius-lg: 1.125rem;
  --radius-xl: 1.5rem;
  --shadow: 0 6px 24px rgba(12, 21, 32, 0.07), 0 1px 0 rgba(255, 255, 255, 0.65) inset;
  --shadow-md: 0 12px 36px rgba(12, 21, 32, 0.1), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  --shadow-lg: 0 20px 50px rgba(12, 21, 32, 0.12);
  --max: 72rem;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --theme-color-meta: #0d6b7a;
  --sheet-bg: linear-gradient(135deg, rgba(255, 253, 249, 1) 0%, rgba(247, 244, 238, 1) 55%, rgba(255, 252, 245, 1) 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.35);
  --sheet-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  --bg-grad-base: linear-gradient(160deg, #eef1f4 0%, #f6f4ef 40%, #f3f5f7 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(13, 107, 122, 0.09) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(201, 162, 39, 0.06) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(13, 107, 122, 0.04) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(61, 78, 95, 0.06) 0%, transparent 48%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --gold: #d9b95f;
  --gold-soft: #c9aa59;
  --bg-page: #141d27;
  --bg-white: #1f2a35;
  --bg-muted: rgba(42, 55, 68, 0.65);
  --border: rgba(217, 234, 246, 0.16);
  --nav-mobile-dash: rgba(217, 234, 246, 0.32);
  --text: #e9f1f8;
  --text-muted: #a8b8c4;
  --text-soft: #8a9bab;
  --accent: #54a6b4;
  --accent-deep: #2d7581;
  --accent-hover: #6eb6c2;
  --accent-mid: #3d8f9e;
  --accent-soft: rgba(84, 166, 180, 0.18);
  --accent-ring: rgba(84, 166, 180, 0.42);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(84, 166, 180, 0.14);
  --surface-active: rgba(84, 166, 180, 0.24);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --theme-color-meta: #1a2530;
  --sheet-bg: linear-gradient(135deg, #1f2a35 0%, #1a2530 55%, #212d39 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.1);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #1a2530 0%, #141d27 45%, #121a22 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(84, 166, 180, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(42, 55, 68, 0.55) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(201, 162, 39, 0.08) 0%, transparent 52%);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-feature-settings: "kern" 1, "liga" 1;
  background-color: var(--bg-page);
  background-image: var(--bg-grad-base), var(--bg-grad-1), var(--bg-grad-2), var(--bg-grad-3), var(--bg-grad-4);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  font-size: 1rem;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

html[data-theme="dark"] body {
  background-image: var(--bg-grad-d0), var(--bg-grad-d1), var(--bg-grad-d2), var(--bg-grad-d3);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

@media (min-width: 640px) {
  .container {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
}

/* Header */
.site-header {
  /* Used to position mobile search panel just below the bar (inner min-height + border + gap) */
  --header-bar-height: calc(3.5rem + 1px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset;
}

html[data-theme="dark"] .site-header {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.header-inner {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
}

/* Right cluster: search → member → theme → style → (mobile) menu */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .header-right {
    gap: 0.75rem;
  }
}

/* Light / dark theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  padding: 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-toggle .theme-icon-sun {
  display: none;
}

.theme-toggle .theme-icon-moon {
  display: block;
}

html[data-theme="dark"] .theme-toggle .theme-icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-toggle .theme-icon-moon {
  display: none;
}

/* Member center icon only (before Style button); guest vs signed colors */
.header-member {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-member-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.header-member-icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* Not signed in: muted neutral */
.header-member-icon-btn--guest {
  background: var(--bg-muted);
  color: var(--text-muted);
  border-color: var(--border);
}

.header-member-icon-btn--guest:hover {
  background: var(--surface-hover);
  color: var(--text-soft);
  border-color: color-mix(in srgb, var(--text-muted) 35%, var(--border));
}

/* Signed in: accent / “online” tint */
.header-member-icon-btn--signed {
  background: color-mix(in srgb, #22c55e 18%, var(--accent-soft));
  color: color-mix(in srgb, #15803d 55%, var(--accent-hover));
  border-color: color-mix(in srgb, #22c55e 42%, var(--border));
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, #22c55e 22%, transparent);
}

.header-member-icon-btn--signed:hover {
  background: color-mix(in srgb, #22c55e 26%, var(--surface-hover));
  color: #166534;
  border-color: color-mix(in srgb, #22c55e 55%, var(--accent-mid));
}

html[data-theme="dark"] .header-member-icon-btn--guest {
  background: color-mix(in srgb, var(--bg-page) 70%, #1a2330);
  color: var(--text-muted);
}

html[data-theme="dark"] .header-member-icon-btn--signed {
  background: color-mix(in srgb, #22c55e 22%, var(--accent-soft));
  color: #86efac;
  border-color: color-mix(in srgb, #22c55e 38%, var(--border));
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, #22c55e 18%, transparent);
}

html[data-theme="dark"] .header-member-icon-btn--signed:hover {
  color: #bbf7d0;
}

/* Mobile only: hamburger (search is a sibling before theme / style) */
.header-mobile-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

@media (min-width: 768px) {
  .header-mobile-actions {
    display: none;
  }
}

/* Mobile header search (magnifier) — first control on small screens */
.header-search-mobile {
  position: relative;
  display: block;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .header-search-mobile {
    display: none;
  }
}

.header-search-mobile-btn {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  cursor: pointer;
  color: var(--accent);
  box-shadow: var(--shadow);
}

.header-search-mobile-btn::-webkit-details-marker,
.header-search-mobile-btn::marker {
  display: none;
}

.header-search-mobile-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
  color: var(--accent-hover);
}

.header-search-mobile[open] .header-search-mobile-btn {
  border-color: var(--accent-mid);
  background: var(--surface-active);
}

.header-search-mobile-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.header-search-mobile-panel {
  position: fixed;
  left: 50%;
  right: auto;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-bar-height, calc(3.5rem + 1px)) + 0.5rem);
  transform: translateX(-50%);
  z-index: 65;
  width: min(22rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  margin: 0;
  padding: 0.75rem;
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
}

.header-search-mobile-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header-search-mobile-form input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  font-size: 1rem;
  background: var(--bg-page);
  color: var(--text);
  outline: none;
}

.header-search-mobile-form input:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.header-search-mobile-submit {
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
  box-shadow: var(--shadow);
}

.header-search-mobile-submit:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
}

/* Desktop header search: icon only → panel with field */
.header-search-desktop {
  display: none;
  position: relative;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .header-search-desktop {
    display: block;
  }
}

.header-search-desktop-btn {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  cursor: pointer;
  color: var(--accent);
  box-shadow: var(--shadow);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.header-search-desktop-btn::-webkit-details-marker,
.header-search-desktop-btn::marker {
  display: none;
}

.header-search-desktop-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
  color: var(--accent-hover);
}

.header-search-desktop[open] .header-search-desktop-btn {
  border-color: var(--accent-mid);
  background: var(--surface-active);
}

.header-search-desktop-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.header-search-desktop-panel {
  position: absolute;
  left: auto;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 65;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
}

.header-search-desktop-form {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}

.header-search-desktop-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 12rem;
  min-width: 0;
}

.header-search-desktop-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: var(--accent);
  pointer-events: none;
}

.header-search-desktop input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.65rem 0.5rem 2.35rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  background: var(--bg-page);
  color: var(--text);
  outline: none;
}

.header-search-desktop input::placeholder {
  color: var(--text-soft);
}

.header-search-desktop input:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.header-search-desktop-submit {
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
  box-shadow: var(--shadow);
  align-self: stretch;
}

.header-search-desktop-submit:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
}

@media (max-width: 900px) {
  .header-search-desktop-form {
    flex-direction: column;
  }

  .header-search-desktop-submit {
    width: 100%;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

a.brand:hover,
a.brand:focus-visible {
  text-decoration: none;
}

.brand-mark {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background: linear-gradient(145deg, var(--accent-mid) 0%, var(--accent) 48%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent-deep) 35%, transparent), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.brand-mark-icon {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  line-height: 1.15;
  min-width: 0;
}

.brand-text {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-chem {
  color: var(--accent);
  transition: color 0.22s ease;
}

.brand-net {
  color: var(--accent-deep);
  transition: color 0.22s ease;
}

.brand-tagline {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  max-width: 11rem;
}

@media (min-width: 400px) {
  .brand-tagline {
    font-size: 0.7rem;
    max-width: none;
    white-space: nowrap;
  }
}

.nav-primary {
  display: none;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-width: 0;
}

@media (min-width: 768px) {
  .nav-primary {
    display: flex;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .nav-primary-top {
    padding: 0.5rem 0.5rem;
    font-size: 0.8125rem;
  }

  .nav-submenu a {
    font-size: 0.8125rem;
    padding: 0.55rem 0.85rem;
  }
}

/* Desktop primary — two-level menu */
.nav-primary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.125rem;
}

.nav-primary-item {
  position: relative;
  list-style: none;
}

.nav-primary-top {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-primary-item.has-submenu .nav-primary-top::after {
  content: "";
  display: block;
  width: 0.3rem;
  height: 0.3rem;
  margin-top: 0.1rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.65;
}

.nav-primary-item:hover .nav-primary-top,
.nav-primary-item:focus-within .nav-primary-top {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.2rem;
  position: absolute;
  left: 0;
  right: auto;
  transform: none;
  /* Pull up under the pill so the panel meets the cursor — no “dead gap” under absolute submenu */
  top: calc(100% - 10px);
  min-width: 13.5rem;
  max-width: min(16rem, calc(100vw - 2rem));
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.08s ease, visibility 0.08s ease;
  z-index: 62;
}

.nav-primary-item:hover .nav-submenu,
.nav-primary-item:focus-within .nav-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-submenu li {
  list-style: none;
}

.nav-submenu li + li {
  border-top: 1px solid var(--border);
}

.nav-submenu a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  line-height: 1.35;
}

.nav-submenu a::before {
  content: "›";
  font-size: 0.82em;
  line-height: 1;
  opacity: 0.75;
  color: currentColor;
  flex: 0 0 auto;
}

.nav-submenu a:hover,
.nav-submenu a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-hover);
  outline: none;
}

.nav-submenu a:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent-ring);
}

/* Mobile menu (details/summary) */
.nav-mobile {
  position: relative;
  display: block;
}

@media (min-width: 768px) {
  .nav-mobile {
    display: none;
  }
}

.nav-mobile-toggle {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-white);
  cursor: pointer;
  color: var(--accent);
  box-shadow: var(--shadow);
}

.nav-mobile-toggle::-webkit-details-marker,
.nav-mobile-toggle::marker {
  display: none;
}

.nav-mobile-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.nav-mobile-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent-mid);
}

.nav-mobile-panel {
  position: absolute;
  left: auto;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 60;
  width: min(20rem, calc(100vw - 2rem));
  /* Fit within viewport below header; --header-bar-height is set on .site-header (inherited here) */
  max-height: calc(100vh - var(--header-bar-height) - max(1.25rem, env(safe-area-inset-bottom, 0px)) - 0.75rem);
  max-height: calc(100dvh - var(--header-bar-height) - max(1.25rem, env(safe-area-inset-bottom, 0px)) - 0.75rem);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  padding: 0.375rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
}

/* Ensure mobile menu is scrollable when content exceeds viewport */
.nav-mobile[open] .nav-mobile-panel {
  max-height: min(76vh, calc(100dvh - var(--header-bar-height) - env(safe-area-inset-bottom, 0px) - 0.75rem));
  overflow-y: auto;
}

.nav-mobile-panel::-webkit-scrollbar {
  width: 8px;
}

.nav-mobile-panel::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 999px;
}

@media (max-width: 900px) {
  .nav-mobile-panel {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-mobile-panel::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
}

.nav-mobile-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Dashed separators between top-level mobile menu rows (Home, leaf links, parent groups) */
.nav-mobile-stack > * + * {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--nav-mobile-dash);
}

.nav-mobile-home {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-mobile-home:hover,
.nav-mobile-home:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-hover);
  outline: none;
}

.nav-mobile-group {
  border-radius: 0.5rem;
}

.nav-mobile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.5rem;
}

.nav-mobile-summary-link {
  flex: 1;
  padding: 0.65rem 0.3rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-mobile-expand {
  flex-shrink: 0;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-white);
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-mobile-expand::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.2rem;
  opacity: 0.9;
  transition: transform 0.2s ease, margin-top 0.2s ease;
}

.nav-mobile-group.is-open > .nav-mobile-summary .nav-mobile-expand::before {
  transform: rotate(225deg);
  margin-top: 0.1rem;
}

.nav-mobile-summary-link:hover,
.nav-mobile-summary-link:focus-visible,
.nav-mobile-expand:hover,
.nav-mobile-expand:focus-visible,
.nav-mobile-summary:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  outline: none;
}

.nav-mobile-sublist {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.35rem 0.5rem 0.5rem 1.15rem;
  margin: 0.35rem 0 0.25rem 0.65rem;
  border-top: 1px dashed var(--nav-mobile-dash);
  border-left: 2px solid var(--accent-soft);
}

.nav-mobile-group .nav-mobile-sublist {
  display: none;
}

.nav-mobile-group[open] .nav-mobile-sublist {
  display: flex;
}

.nav-mobile-group.is-open .nav-mobile-sublist {
  display: flex;
}

.nav-mobile-sublist[hidden] {
  display: none !important;
}

.nav-mobile-sublist a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.nav-mobile-sublist a::before {
  content: "›";
  font-size: 0.82em;
  line-height: 1;
  opacity: 0.75;
  color: currentColor;
  flex: 0 0 auto;
}

/* Dashed separators between submenu links */
.nav-mobile-sublist a + a {
  margin-top: 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--nav-mobile-dash);
}

.nav-mobile-sublist a:hover,
.nav-mobile-sublist a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-hover);
  outline: none;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  text-decoration: none;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
}

html[data-theme="dark"] .brand-mark {
  background: linear-gradient(145deg, var(--accent-mid), var(--accent-deep));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Hero background slideshow */
.hero--slider {
  min-height: 22rem;
}

.hero--slider .hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slider-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-slider-track {
  display: flex;
  height: 100%;
  min-height: 22rem;
  transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slider-track {
    transition: none;
  }
}

.hero-slide {
  flex-shrink: 0;
  height: 100%;
  min-height: 22rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-slider-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 24, 32, 0.16) 0%, transparent 48%),
    linear-gradient(to bottom, rgba(8, 32, 40, 0.12), rgba(6, 18, 28, 0.54)),
    radial-gradient(ellipse 90% 58% at 100% 0%, rgba(13, 107, 122, 0.1) 0%, transparent 52%),
    radial-gradient(ellipse 80% 55% at 0% 100%, rgba(201, 162, 39, 0.06) 0%, transparent 55%);
}

html[data-theme="dark"] .hero-slider-scrim {
  background:
    linear-gradient(180deg, rgba(8, 16, 24, 0.38) 0%, transparent 42%),
    linear-gradient(to bottom, rgba(10, 20, 30, 0.3), rgba(4, 10, 18, 0.74)),
    radial-gradient(ellipse 95% 58% at 100% 0%, rgba(84, 166, 180, 0.11) 0%, transparent 52%),
    radial-gradient(ellipse 85% 52% at 0% 100%, rgba(201, 162, 39, 0.06) 0%, transparent 58%);
}

.hero-slider-arrow {
  position: absolute;
  top: 42%;
  z-index: 5;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-slider-arrow:hover {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(255, 255, 255, 0.65);
  transform: translateY(-50%) scale(1.05);
}

.hero-slider-prev {
  left: 0.75rem;
}

.hero-slider-next {
  right: 0.75rem;
}

@media (max-width: 639px) {
  .hero-slider-arrow {
    width: 2.25rem;
    height: 2.25rem;
  }

  .hero-slider-prev {
    left: 0.5rem;
  }

  .hero-slider-next {
    right: 0.5rem;
  }
}

.hero-slider-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.hero-slider-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.hero-slider-dot:hover {
  background: rgba(255, 255, 255, 0.75);
}

.hero-slider-dot.is-active {
  background: #fff;
  transform: scale(1.25);
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 2rem 0 3rem;
}

.hero--slider .hero-kicker {
  color: #e8d48a;
  letter-spacing: 0.22em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero.hero--slider h1 {
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 3px 30px rgba(0, 0, 0, 0.52), 0 1px 2px rgba(0, 0, 0, 0.38);
}

.hero--slider .hero-lead {
  color: rgba(241, 245, 249, 0.92);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 640px) {
  .hero-inner {
    padding: 3rem 0 4rem;
  }
}

@media (min-width: 1024px) {
  .hero-inner {
    padding: 4rem 0 5rem;
  }
}

.hero--slider .hero-inner {
  padding-bottom: 4.5rem;
}

@media (min-width: 640px) {
  .hero--slider .hero-inner {
    padding-bottom: 5.5rem;
  }
}

@media (min-width: 1024px) {
  .hero--slider .hero-inner {
    padding-bottom: 6.5rem;
  }
}

.hero--slider .trending span {
  color: rgba(226, 232, 240, 0.88);
}

.hero--slider .trending a {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.hero--slider .trending a:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.hero-kicker {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero h1 {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Keep the updated homepage hero title on one line on desktop */
@media (min-width: 1200px) {
  .hero--slider #hero-title {
    font-size: clamp(1.9rem, 2.4vw, 2.45rem);
    white-space: normal;
  }
}

.hero-lead {
  margin: 1rem auto 0;
  max-width: 42rem;
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (min-width: 640px) {
  .hero-lead {
    font-size: 1.125rem;
  }
}

.search-form {
  margin: 2.5rem auto 0;
  max-width: 42rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .search-form {
    flex-direction: row;
    align-items: center;
  }
}

/* Contact page (contact.html) */
.contact-subnav {
  margin-top: 0.35rem;
}

.contact-top-grid {
  display: grid;
  gap: 1.75rem;
  align-items: stretch;
  margin-top: 0.75rem;
}

@media (min-width: 960px) {
  .contact-top-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 2rem;
  }
}

.contact-top-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-top-col--office .contact-info-card {
  flex: 1 1 auto;
}

.contact-top-form-heading {
  margin: 0 0 1rem;
  flex-shrink: 0;
  font-size: 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.contact-top-grid .contact-form-panel {
  max-width: none;
  width: 100%;
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.contact-top-col--form .contact-page-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.contact-top-col--form .contact-page-form .inquiry-field:has(textarea) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 1rem;
}

.contact-top-col--form .contact-page-form .inquiry-field:has(textarea) textarea {
  flex: 1 1 auto;
  min-height: 6rem;
}

.contact-page-intro {
  display: grid;
  gap: 1.75rem;
  align-items: start;
  margin-top: 0.5rem;
}

@media (min-width: 900px) {
  .contact-page-intro {
    grid-template-columns: minmax(0, 1fr) minmax(0, 17.5rem);
    gap: 2rem;
  }
}

.contact-info-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
}

.contact-info-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.56;
  background:
    radial-gradient(circle at 9% 14%, rgba(36, 112, 177, 0.26) 0 1.7px, transparent 2px),
    radial-gradient(circle at 18% 28%, rgba(36, 112, 177, 0.22) 0 1.7px, transparent 2px),
    radial-gradient(circle at 28% 16%, rgba(36, 112, 177, 0.24) 0 1.7px, transparent 2px),
    radial-gradient(circle at 36% 34%, rgba(36, 112, 177, 0.2) 0 1.7px, transparent 2px),
    radial-gradient(circle at 47% 18%, rgba(36, 112, 177, 0.25) 0 1.7px, transparent 2px),
    radial-gradient(circle at 58% 31%, rgba(36, 112, 177, 0.22) 0 1.7px, transparent 2px),
    radial-gradient(circle at 69% 14%, rgba(36, 112, 177, 0.24) 0 1.7px, transparent 2px),
    radial-gradient(circle at 81% 29%, rgba(36, 112, 177, 0.2) 0 1.7px, transparent 2px),
    radial-gradient(circle at 14% 52%, rgba(36, 112, 177, 0.22) 0 1.7px, transparent 2px),
    radial-gradient(circle at 26% 68%, rgba(36, 112, 177, 0.24) 0 1.7px, transparent 2px),
    radial-gradient(circle at 40% 55%, rgba(36, 112, 177, 0.2) 0 1.7px, transparent 2px),
    radial-gradient(circle at 52% 73%, rgba(36, 112, 177, 0.26) 0 1.7px, transparent 2px),
    radial-gradient(circle at 66% 58%, rgba(36, 112, 177, 0.22) 0 1.7px, transparent 2px),
    radial-gradient(circle at 78% 74%, rgba(36, 112, 177, 0.24) 0 1.7px, transparent 2px),
    radial-gradient(circle at 88% 54%, rgba(36, 112, 177, 0.2) 0 1.7px, transparent 2px),
    linear-gradient(34deg, transparent 13.5%, rgba(36, 112, 177, 0.2) 13.5% 14.5%, transparent 14.5%),
    linear-gradient(-22deg, transparent 21.4%, rgba(36, 112, 177, 0.18) 21.4% 22.4%, transparent 22.4%),
    linear-gradient(18deg, transparent 30.5%, rgba(36, 112, 177, 0.2) 30.5% 31.5%, transparent 31.5%),
    linear-gradient(-14deg, transparent 39.8%, rgba(36, 112, 177, 0.18) 39.8% 40.8%, transparent 40.8%),
    linear-gradient(26deg, transparent 49.2%, rgba(36, 112, 177, 0.2) 49.2% 50.2%, transparent 50.2%),
    linear-gradient(-18deg, transparent 58.1%, rgba(36, 112, 177, 0.18) 58.1% 59.1%, transparent 59.1%),
    linear-gradient(20deg, transparent 67.2%, rgba(36, 112, 177, 0.2) 67.2% 68.2%, transparent 68.2%),
    linear-gradient(-24deg, transparent 76.3%, rgba(36, 112, 177, 0.18) 76.3% 77.3%, transparent 77.3%);
}

.contact-info-card > * {
  position: relative;
  z-index: 1;
}

.contact-info-section + .contact-info-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed color-mix(in srgb, var(--border) 82%, transparent);
}

.contact-info-section {
  --section-accent: color-mix(in srgb, var(--accent) 74%, var(--text) 26%);
  --section-soft: color-mix(in srgb, var(--accent) 14%, var(--bg-white));
}

.contact-info-section--head {
  --section-accent: #0b7aa8;
  --section-soft: rgba(11, 122, 168, 0.1);
}

.contact-info-section--biz {
  --section-accent: #0f8a5f;
  --section-soft: rgba(15, 138, 95, 0.1);
}

.contact-info-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.22rem 0.55rem 0.24rem;
  border-radius: 999px;
  background: var(--section-soft);
  color: var(--section-accent);
  font-size: 0.95rem;
  font-family: var(--font-display);
  font-weight: 700;
}

.contact-info-title::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--section-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--section-accent) 16%, transparent);
}

.contact-info-dl {
  margin: 0;
}

.contact-info-dl > div {
  margin: 0 0 0.85rem;
}

.contact-info-dl > div:last-child {
  margin-bottom: 0;
}

.contact-info-dl dt {
  margin: 0 0 0.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.contact-info-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: var(--section-soft);
  color: var(--section-accent);
}

.contact-info-label-icon svg {
  width: 0.7rem;
  height: 0.7rem;
  stroke: currentColor;
}

.contact-info-dl dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.contact-info-dl a {
  color: var(--section-accent);
  text-decoration: none;
  font-weight: 600;
}

.contact-info-dl a:hover {
  text-decoration: underline;
}

.contact-form-panel {
  max-width: 38rem;
  margin: 0.5rem auto 0;
  padding: 1.5rem 1.35rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
}

.contact-captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.contact-captcha-row input {
  flex: 1 1 10rem;
  min-width: 0;
}

.contact-captcha-img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  vertical-align: middle;
}

.inquiry-actions--contact {
  justify-content: stretch;
}

.inquiry-actions--contact .inquiry-btn-submit {
  width: 100%;
  justify-content: center;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
  pointer-events: none;
  opacity: 0.85;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.search-form .btn-dark {
  padding: 0.875rem 2rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.search-form .btn-dark:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
}

.hero--slider .search-input-wrap .search-input {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  color: #f8fafc;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.hero--slider .search-input::placeholder {
  color: rgba(226, 232, 240, 0.62);
}

.hero--slider .search-input-wrap .search-icon {
  color: rgba(232, 212, 168, 0.95);
  opacity: 1;
}

.hero--slider .search-input:focus {
  border-color: rgba(84, 166, 180, 0.75);
  box-shadow: 0 0 0 3px rgba(13, 107, 122, 0.35), 0 8px 28px rgba(0, 0, 0, 0.22);
}

.hero--slider .search-form .btn-dark {
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero--slider .search-form .btn-dark:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

@media (max-width: 639px) {
  .search-form .btn-dark {
    width: 100%;
    min-height: 2.75rem;
  }
}

/* Avoid iOS zoom on focus: keep form controls at least 16px on narrow viewports */
@media (max-width: 767px) {
  .search-input,
  .program-fields input,
  .program-fields select,
  .filter-bar select {
    font-size: 1rem;
  }
}

.trending {
  margin: 2rem auto 0;
  max-width: 42rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
}

@media (min-width: 480px) {
  .trending {
    justify-content: center;
  }
}

.trending span {
  color: var(--text-soft);
}

.trending a {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.trending a:hover {
  border-color: var(--accent-mid);
  color: var(--accent-hover);
  background: var(--accent-soft);
}

/* Sections */
.section {
  scroll-margin-top: 4.5rem;
  border-bottom: 1px solid var(--border);
  padding: 2.75rem 0;
}

@media (min-width: 640px) {
  .section {
    padding: 3.5rem 0;
    scroll-margin-top: 5rem;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: 4rem 0;
  }
}

.section-bg {
  background: var(--bg-muted);
}

.section h2 {
  margin: 0;
  font-size: clamp(1.375rem, 4.5vw, 1.875rem);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  word-wrap: break-word;
  color: var(--text);
}

.section h2.center::after {
  content: "";
  display: block;
  width: 3.25rem;
  height: 0.22rem;
  margin: 0.85rem auto 0;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--gold-soft));
}

.section h2:not(.center)::after {
  content: "";
  display: block;
  width: 2.75rem;
  height: 0.22rem;
  margin-top: 0.85rem;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--accent-deep), var(--gold-soft));
}

.section-intro {
  margin: 1rem 0 0;
  max-width: 48rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.section-intro.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-intro.section-intro-wide {
  max-width: none;
  width: 100%;
  text-align: justify;
  text-align-last: left;
}

.section-intro a {
  color: var(--accent);
  font-weight: 600;
}

.section h2.center {
  text-align: center;
}

/* Grid cards */
.grid-4 {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: var(--sheet-border);
  background: var(--sheet-bg);
  padding: 1.5rem;
  box-shadow: var(--sheet-shadow);
  transition: box-shadow 0.28s ease, transform 0.28s ease, border-color 0.25s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--gold-soft));
  opacity: 0;
  transition: opacity 0.28s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  margin: 0;
  font-size: 1.125rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

#tools .tools-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

#tools .tools-card-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.12rem;
  color: var(--accent);
  opacity: 0.95;
}

#tools .tools-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

#agents .agents-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

#agents .agents-card-icon {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.08rem;
  color: var(--accent);
  opacity: 0.95;
}

#agents .agents-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.card p {
  margin: 0.5rem 0 0;
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.link-cta {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, gap 0.2s ease;
}

.link-cta:hover {
  color: var(--accent-hover);
  text-decoration: none;
  gap: 0.5rem;
}

.link-cta svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.link-cta:hover svg {
  transform: translateX(4px);
}

/* Database panel */
.filters-panel {
  margin-top: 2.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

@media (min-width: 640px) {
  .filters-panel {
    padding: 2rem;
  }
}

.filters-panel h3 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.filter-block {
  margin-top: 1.5rem;
}

.filter-block h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

/* Narrow screens: horizontal scroll for A–Z strip */
.letter-scroll {
  margin-top: 0.75rem;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding: 0 0.25rem 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

@media (min-width: 480px) {
  .letter-scroll {
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    overflow: visible;
  }
}

.letter-row {
  margin-top: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.375rem;
  min-width: min-content;
}

@media (min-width: 480px) {
  .letter-row {
    flex-wrap: wrap;
    min-width: 0;
  }
}

.letter-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.letter-btn:hover {
  border-color: var(--accent-mid);
  color: var(--accent-hover);
  background: var(--accent-soft);
}

.letter-btn.active {
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
  border-color: var(--accent);
}

.filter-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.filter-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.filter-list li {
  margin: 0.25rem 0;
}

.filter-list button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}

.filter-list button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.badge-sky {
  background: var(--accent-soft);
  border-color: var(--border);
  color: var(--accent-hover);
}

.filter-bar {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .filter-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.filter-bar select {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  background: var(--bg-white);
}

.grid-3 {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.product-card .badge-sky {
  margin-right: 0.25rem;
}

.product-card .meta {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-soft);
}

/* News */
.grid-news {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-news {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-news {
    grid-template-columns: repeat(3, 1fr);
  }
}

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: var(--sheet-border);
  background: var(--sheet-bg);
  padding: 1.5rem;
  box-shadow: var(--sheet-shadow);
  transition: box-shadow 0.28s ease, transform 0.28s ease, border-color 0.25s ease;
}

.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--gold-soft));
  opacity: 0;
  transition: opacity 0.28s ease;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}

.news-card:hover::before {
  opacity: 1;
}

.news-meta {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.news-card h3 {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.news-card p {
  margin: 0.5rem 0 0;
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.news-footer {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
}

@media (max-width: 380px) {
  .news-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

.news-footer .views {
  color: #94a3b8;
}

.dashed-box {
  margin-top: 3rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  background: var(--bg-white);
  padding: 1.5rem;
}

.dashed-box h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.ref-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.ref-list .strong {
  font-weight: 600;
  color: var(--text);
}

@media (min-width: 640px) {
  .ref-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .ref-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Research */
.program-search {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .program-search {
    padding: 2rem;
  }
}

.program-search h3 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.program-fields {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .program-fields {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .program-fields {
    grid-template-columns: repeat(4, 1fr);
  }
}

.program-fields input,
.program-fields select {
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.program-search .btn-dark {
  margin-top: 1rem;
  padding: 0.625rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
  border: none;
  cursor: pointer;
  width: 100%;
  min-height: 2.75rem;
  box-shadow: var(--shadow);
}

.program-search .btn-dark:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
}

@media (min-width: 480px) {
  .program-search .btn-dark {
    width: auto;
    min-height: unset;
  }
}

.trial-card {
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: var(--sheet-border);
  background: var(--sheet-bg);
  padding: 1.5rem;
  box-shadow: var(--sheet-shadow);
  transition: box-shadow 0.28s ease, transform 0.28s ease, border-color 0.25s ease;
}

.trial-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}

@media (min-width: 640px) {
  .trial-card {
    padding: 2rem;
  }
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pill-sky {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.pill-green {
  background: #ecfdf5;
  color: #166534;
}

.trial-card h4 {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.dl-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .dl-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dl-grid dt {
  margin: 0;
  font-weight: 500;
  color: var(--text-soft);
}

.dl-grid dd {
  margin: 0;
}

/* Education (index #education) */
#education .edu-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

#education .edu-card-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
  color: var(--accent);
  opacity: 0.95;
}

#education .edu-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.grid-edu {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-edu {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-edu {
    grid-template-columns: repeat(3, 1fr);
  }
}

.edu-card ul {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.edu-card li {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.edu-card li::before {
  content: "";
  margin-top: 0.4rem;
  width: 0.375rem;
  height: 0.375rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: var(--accent-mid);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.learn-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .learn-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.learn-card .tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.learn-card h4 {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  font-weight: 600;
}

.center-link {
  margin-top: 1.5rem;
  text-align: center;
}

.center-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(13, 107, 122, 0.24);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.center-link a:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(10, 58, 66, 0.4);
}

/* About */
.about-grid {
  margin-top: 2.5rem;
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.about-box {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 1.5rem;
}

.about-box h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.about-box-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-box-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--accent);
  flex-shrink: 0;
}

.about-box-title-icon svg {
  width: 100%;
  height: 100%;
}

.about-box p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.contact-box {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.contact-box a {
  color: var(--accent);
  font-weight: 500;
}

/* About page (about.html) — banner with photo + scrim */
.page-hero {
  --page-hero-image: url("images/about-banner.png");
  position: relative;
  overflow: hidden;
  min-height: 18rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--accent-deep);
  background-image:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent-deep) 58%, transparent) 0%,
      color-mix(in srgb, var(--accent-strong) 72%, transparent) 100%
    ),
    var(--page-hero-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

html[data-theme="dark"] .page-hero {
  background-image:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent-deep) 46%, black 54%) 0%,
      color-mix(in srgb, var(--accent-deep) 30%, black 70%) 100%
    ),
    var(--page-hero-image);
}

.page-hero .hero-kicker {
  color: #e8d48a;
  letter-spacing: 0.22em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero.page-hero h1,
.hero.page-hero .hero-page-title {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-hero .hero-lead {
  max-width: 46rem;
  color: rgba(241, 245, 249, 0.92);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.page-hero .about-subnav a {
  color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.page-hero .about-subnav a:hover,
.page-hero .about-subnav a:focus-visible {
  border-bottom-color: rgba(255, 255, 255, 0.9);
}

.page-hero .hero-inner {
  position: relative;
  z-index: 1;
  padding: 2.75rem 0 3.25rem;
}

@media (min-width: 640px) {
  .page-hero .hero-inner {
    padding: 3.25rem 0 3.75rem;
  }
}

@media (min-width: 1024px) {
  .page-hero .hero-inner {
    padding: 3.75rem 0 4.25rem;
  }
}

.about-subnav {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.about-subnav a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.about-subnav a:hover,
.about-subnav a:focus-visible {
  border-bottom-color: var(--accent-mid);
  outline: none;
}

.prose-block {
  max-width: 44rem;
}

.prose-block p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.prose-block p:last-child {
  margin-bottom: 0;
}

/* Company section: left column = copy, right column = slideshow (about.html) */
.company-split {
  margin-top: 1.25rem;
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 768px) {
  .company-split {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
  }

  .company-split-text {
    padding-right: 1.5rem;
    border-right: 1px solid var(--border);
  }
}

@media (min-width: 1024px) {
  .company-split {
    gap: 2.75rem;
  }

  .company-split-text {
    padding-right: 2rem;
  }
}

.company-split-text {
  min-width: 0;
}

.company-split-intro.section-intro {
  margin-top: 0;
  max-width: none;
}

.company-split-prose.prose-block {
  max-width: none;
  margin-top: 1.25rem;
}

.company-showcase {
  width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .company-showcase {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .company-showcase-frame {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  .company-showcase-viewport {
    flex: 1;
    min-height: 0;
  }

  .company-showcase-slide {
    min-height: 16rem;
  }
}

.company-showcase-frame {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.company-showcase-viewport {
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.company-showcase-viewport:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent-ring);
}

.company-showcase-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .company-showcase-track {
    transition: none;
  }
}

.company-showcase-slide {
  flex-shrink: 0;
  height: 100%;
  min-height: 14rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (min-width: 640px) {
  .company-showcase-slide {
    min-height: 16rem;
  }
}

@media (min-width: 768px) {
  .company-showcase-viewport {
    height: 100%;
  }

  .company-showcase-slide {
    min-height: 100%;
  }
}

.company-showcase-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.company-showcase-arrow:hover {
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(255, 255, 255, 0.65);
}

.company-showcase-prev {
  left: 0.5rem;
}

.company-showcase-next {
  right: 0.5rem;
}

.company-showcase-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.75rem;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
}

.company-showcase-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: var(--text-soft);
  opacity: 0.45;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.company-showcase-dot:hover {
  opacity: 0.85;
}

.company-showcase-dot.is-active {
  background: var(--accent);
  opacity: 1;
  transform: scale(1.25);
}

html[data-theme="dark"] .company-showcase-dot.is-active {
  background: var(--accent);
}

/* Our journey — one year per slide (about.html), same pattern as image carousel */
.journey-carousel {
  position: relative;
  margin-top: 2rem;
}

.journey-frame {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.journey-viewport {
  position: relative;
  overflow: hidden;
  min-height: 15rem;
  touch-action: manipulation;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.journey-viewport:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent-ring);
}

.journey-track {
  display: flex;
  gap: 0.5rem;
  height: 100%;
  min-height: 15rem;
  transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .journey-track {
    transition: none;
  }
}

.journey-slide {
  flex-shrink: 0;
  height: 100%;
  min-height: 15rem;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  box-sizing: border-box;
  padding: 0.35rem 0;
}

@media (min-width: 640px) {
  .journey-slide {
    min-height: 16rem;
    padding: 0.5rem 0;
  }
}

.journey-slide .journey-card {
  width: 100%;
  max-width: none;
  margin: 0;
  align-self: stretch;
}

.journey-card {
  padding: 1rem 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  .journey-card {
    padding: 1.1rem 0.85rem;
  }
}

.journey-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.75rem;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
}

.journey-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: var(--text-soft);
  opacity: 0.45;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.journey-dot:hover {
  opacity: 0.85;
}

.journey-dot.is-active {
  background: var(--accent);
  opacity: 1;
  transform: scale(1.25);
}

html[data-theme="dark"] .journey-dot.is-active {
  background: var(--accent);
}

.journey-year {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.journey-card h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}

.journey-card p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.journey-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--bg-white);
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.journey-arrow:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent-mid);
  color: var(--accent-hover);
}

.journey-arrow:focus-visible {
  outline: none;
  box-shadow: var(--shadow), 0 0 0 2px var(--accent-ring);
}

.journey-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.journey-arrow-prev {
  left: 0.5rem;
}

.journey-arrow-next {
  right: 0.5rem;
}

/* News layout: main + right sidebar (newslist.html, news.html) */
.news-with-sidebar {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .news-with-sidebar {
    grid-template-columns: minmax(0, 1fr) 17.5rem;
    gap: 2.5rem;
  }
}

@media (min-width: 1200px) {
  .news-with-sidebar {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }
}

.news-with-sidebar-main {
  min-width: 0;
}

.news-sidebar {
  min-width: 0;
}

@media (min-width: 1024px) {
  .news-sidebar {
    position: sticky;
    top: 5.5rem;
  }
}

.news-sidebar-block {
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
}

.news-sidebar-block:last-child {
  margin-bottom: 0;
}

.news-sidebar-title {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* Tags block: extra space between heading and tag chips */
.news-sidebar-block:has(> .news-sidebar-tags) .news-sidebar-title {
  margin-bottom: 1.45rem;
}

.news-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-sidebar-list li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.news-sidebar-list li:last-child {
  border-bottom: none;
}

.news-sidebar-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 0.35rem;
}

.news-sidebar-list a:hover {
  color: var(--accent-hover);
  background: var(--accent-soft);
}

.news-sidebar-list a.is-active {
  color: var(--accent-deep);
  font-weight: 600;
}

html[data-theme="dark"] .news-sidebar-list a.is-active {
  color: var(--accent);
}

.news-sidebar-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
}

.news-sidebar-list--compact a {
  padding: 0.45rem 0.25rem;
}

.news-sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.news-sidebar-tag {
  display: inline-block;
  padding: 0.3rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.news-sidebar-tag:hover {
  border-color: var(--accent-mid);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.news-sidebar-related {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.news-detail-page .news-sidebar-related {
  margin-top: 0.75rem;
}

.news-sidebar-related li {
  margin: 0 0 0.5rem;
}

.news-sidebar-related li:last-child {
  margin-bottom: 0;
}

.news-sidebar-related a {
  display: block;
  max-width: 100%;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-sidebar-related a:hover {
  text-decoration: underline;
}

/* product.html — Related: space above list */
.news-sidebar-related.product-related-list {
  margin-top: 1rem;
  padding-top: 0.35rem;
}

/* Product list (productlist.html) */
.product-list-search {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .product-list-search {
    flex-direction: row;
    align-items: stretch;
    gap: 0.85rem;
  }
}

.product-list-search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.product-list-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 1.125rem;
  height: 1.125rem;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}

.product-list-search-input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 0.9375rem;
  color: var(--text);
  box-shadow: var(--shadow);
}

.product-list-search-input::placeholder {
  color: var(--text-soft);
}

.product-list-search-input:focus {
  outline: none;
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.product-list-search-submit {
  flex-shrink: 0;
}

.product-list-results {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.product-list-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.product-list-sort label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
}

.product-list-sort select {
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
}

.product-list-cas {
  margin: 0.15rem 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-card-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
}

html[data-theme="dark"] .product-list-cas {
  color: var(--accent);
}

.product-list-grid {
  margin-top: 0;
}

/* Product list — image, title, CAS (productlist.html) */
.card.product-card--thumb {
  padding: 0;
}

.product-card--thumb .product-card-media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-muted);
}

.product-card--thumb .product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.product-card--thumb:hover .product-card-media img {
  transform: scale(1.04);
}

.product-card--thumb .product-card-stack {
  padding: 1rem 1.15rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.product-card--thumb .product-card-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
}

.product-card--thumb .product-card-title a {
  color: var(--text);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card--thumb .product-card-title a:hover {
  color: var(--accent);
}

.product-list-cas--inline {
  margin: 0 !important;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.8125rem;
  line-height: 1.4;
  position: absolute;
  left: 1.15rem;
  right: 1.15rem;
  bottom: 0.4rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.product-card--thumb .product-card-media:hover + .product-card-stack .product-list-cas--inline {
  opacity: 1;
  transform: translateY(0);
}

.product-card--thumb .product-list-cas-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  flex-shrink: 0;
}

.product-card--thumb .product-list-cas-value {
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  min-width: 0;
}

.product-title-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 0.18s ease, transform 0.18s ease;
  padding: 0.35rem 0.55rem;
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--accent) 88%, #0f1b24);
  color: var(--bg-white);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  max-width: min(70vw, 26rem);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.product-title-tooltip.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Product detail (product.html) & news article (news.html): light content sheet */
body.product-detail-page .news-with-sidebar-main > article.news-detail,
body.news-detail-page .news-with-sidebar-main > article.news-detail {
  padding: clamp(1.35rem, 3vw, 2rem) clamp(0.85rem, 2.5vw, 1.35rem);
  border-radius: var(--radius-xl);
  background: #fbfbf9;
  border: 1px solid rgba(12, 21, 32, 0.07);
  box-shadow: 0 2px 24px rgba(12, 21, 32, 0.045);
}

html[data-theme="dark"] body.product-detail-page .news-with-sidebar-main > article.news-detail,
html[data-theme="dark"] body.news-detail-page .news-with-sidebar-main > article.news-detail {
  background: color-mix(in srgb, var(--bg-white) 88%, #0d141c);
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

article.news-detail .news-breadcrumb.product-detail-breadcrumb {
  margin-bottom: 1.75rem;
}

.product-hero-grid {
  display: grid;
  gap: 1.75rem;
  align-items: stretch;
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .product-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: stretch;
  }
}

.product-gallery {
  --slide-count: 4;
  --gallery-main-max: min(62vh, 30rem);
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.product-gallery-viewport {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 15rem;
  max-height: var(--gallery-main-max);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  box-shadow: var(--shadow);
  touch-action: pan-y pinch-zoom;
  outline: none;
}

.product-gallery-viewport:focus-visible {
  box-shadow: var(--shadow), 0 0 0 3px var(--accent-ring);
}

.product-gallery-track {
  display: flex;
  flex: 1 1 auto;
  width: calc(var(--slide-count) * 100%);
  height: 100%;
  min-height: 0;
  align-items: stretch;
  align-self: stretch;
  transform: translateX(0);
  transition: transform 0.38s cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .product-gallery-track {
    transition-duration: 0.01ms;
  }
}

.product-gallery-slide {
  flex: 0 0 calc(100% / var(--slide-count));
  margin: 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-gallery-slide img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  vertical-align: middle;
  display: block;
  object-fit: contain;
  object-position: center;
  transform-origin: var(--detail-zoom-x, 50%) var(--detail-zoom-y, 50%);
  transition: transform 0.18s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.product-gallery-slide {
  cursor: zoom-in;
}

.product-gallery-slide.is-zooming img {
  transform: scale(1.75);
}

.product-gallery-thumbs-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  flex-shrink: 0;
}

.product-gallery-thumbs-scroll {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.2rem 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.product-gallery-thumbs-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.product-gallery-thumb {
  flex: 0 0 auto;
  width: 4.25rem;
  height: 4.25rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--bg-white);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-gallery-thumb:hover {
  border-color: var(--accent-soft);
}

.product-gallery-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-mid);
}

.product-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 3px);
  display: block;
}

.product-gallery-thumbs-nav {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.product-gallery-thumbs-nav:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
}

.product-summary-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  justify-content: flex-start;
}

.product-summary-panel .news-detail-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.product-summary-panel .news-detail-title {
  margin: 0.5rem 0 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-summary-panel .product-summary-updated {
  margin-top: auto;
  padding-top: 1rem;
}

.product-summary-meta {
  margin: 1.15rem 0 0;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  overflow: hidden;
}

.product-summary-meta-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 6.5rem) 1fr;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  border-bottom: 1px solid var(--border);
}

.product-summary-meta-row:last-child {
  border-bottom: none;
}

.product-summary-meta dt {
  margin: 0;
  font-weight: 400;
  color: var(--text-soft);
}

.product-summary-meta dd {
  margin: 0;
  font-weight: 400;
  color: var(--text-muted);
  word-break: break-word;
}

.product-summary-updated {
  margin: 0.85rem 0 0;
}

.product-description-block {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.product-detail-block {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.product-block-title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.product-description-inner {
  max-width: 52rem;
  min-width: 0;
  overflow: hidden;
}

.product-description-text {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* CMS HTML: keep media inside the content column */
.product-description-text img,
.product-description-text video,
.product-description-text iframe {
  max-width: 100%;
  height: auto;
}

.product-description-text img,
.product-description-text video {
  display: block;
}

.product-detail-block .product-detail-body {
  margin-top: 0.25rem;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.product-detail-block .product-detail-body p,
.product-detail-block .product-detail-body li,
.product-detail-block .product-detail-body td,
.product-detail-block .product-detail-body th,
.product-detail-block .product-detail-body div,
.product-detail-block .product-detail-body span,
.product-detail-block .product-detail-body a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 899px) {
  .product-gallery {
    height: auto;
    min-height: 0;
  }

  .product-gallery-viewport {
    flex: none;
    max-height: none;
    min-height: 12.5rem;
    aspect-ratio: 4 / 3;
  }

  .product-summary-panel {
    height: auto;
  }

  .product-summary-panel .product-summary-updated {
    margin-top: 0.85rem;
    padding-top: 0;
  }

  .product-summary-meta-row {
    grid-template-columns: minmax(4rem, 5.5rem) 1fr;
    font-size: 0.8125rem;
  }
}

.product-spec-panel {
  margin: 0.85rem 0 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  overflow: hidden;
}

.product-spec-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9.5rem) 1fr;
  gap: 0.5rem 1rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  border-bottom: 1px solid var(--border);
}

.product-spec-row:last-child {
  border-bottom: none;
}

.product-spec-label {
  font-weight: 600;
  color: var(--text-soft);
}

.product-spec-value {
  margin: 0;
  color: var(--text-muted);
}

.product-detail-prev-next {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.product-detail-prev-next p {
  margin: 0.35rem 0;
}

.product-detail-nav-label {
  display: inline-block;
  min-width: 4.5rem;
  margin-right: 0.35rem;
  font-weight: 600;
  color: var(--text-soft);
}

.product-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.product-summary-inquiry {
  margin: 1.15rem 0 0;
}

.product-summary-inquiry .btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.65rem 1.15rem;
  box-sizing: border-box;
}

.product-detail-actions .btn-dark,
.product-summary-inquiry .btn-dark {
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(180deg, var(--accent-mid), var(--accent));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.product-detail-actions .btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.15rem;
}

.product-detail-actions .btn-dark:hover,
.product-summary-inquiry .btn-dark:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-hover));
  color: #fff;
}

.product-summary-inquiry button.btn-dark {
  font-family: inherit;
}

/* Product inquiry modal (product.html + FormSubmit) */
.inquiry-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.inquiry-modal[hidden] {
  display: none !important;
}

.inquiry-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 21, 32, 0.55);
  backdrop-filter: blur(4px);
}

html[data-theme="dark"] .inquiry-modal-backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.inquiry-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  max-height: min(92vh, 40rem);
  overflow: auto;
  padding: 1.5rem 1.5rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.inquiry-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.inquiry-modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.inquiry-modal-title {
  margin: 0 2rem 0 0;
  font-size: 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.inquiry-modal-lead {
  margin: 0.65rem 0 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.inquiry-form .inquiry-field {
  margin-bottom: 1rem;
}

.inquiry-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
}

.inquiry-required {
  color: var(--accent);
}

.inquiry-form input[type="text"],
.inquiry-form input[type="email"],
.inquiry-form input[type="tel"],
.inquiry-form textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  font-size: 0.9375rem;
  color: var(--text);
  box-sizing: border-box;
}

.inquiry-form input:focus,
.inquiry-form textarea:focus {
  outline: none;
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.inquiry-form .inquiry-field.has-error input,
.inquiry-form .inquiry-field.has-error textarea {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.contact-field-error {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: #b91c1c;
  line-height: 1.4;
}

.inquiry-form textarea {
  resize: vertical;
  min-height: 6rem;
  line-height: 1.5;
}

.inquiry-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.inquiry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.15rem;
  padding-top: 0.25rem;
}

.inquiry-btn-secondary {
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.inquiry-btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
}

.inquiry-btn-submit {
  padding: 0.55rem 1.15rem !important;
  width: auto !important;
}

body.inquiry-modal-open {
  overflow: hidden;
}

/* News list (newslist.html) */
.news-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.news-toolbar-label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.news-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.news-chip {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.news-chip:hover {
  border-color: var(--accent-mid);
  color: var(--accent-hover);
  background: var(--accent-soft);
}

.news-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

html[data-theme="dark"] .news-chip.is-active {
  color: var(--accent);
}

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

.news-year-empty {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.news-sidebar-muted {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.news-card {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
  .news-card {
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.35rem 1.5rem;
    align-items: start;
  }

  /* newslist.html: image column and text column share the same top/bottom (equal row height) */
  .news-list .news-card {
    align-items: stretch;
  }

  .news-list .news-card > .news-card-media {
    display: block;
    align-self: stretch;
    height: 100%;
    min-height: 12rem;
    aspect-ratio: unset;
  }

  .news-list .news-card > .news-card-media img {
    width: 100%;
    height: 100%;
    min-height: 12rem;
    object-fit: cover;
    object-position: center;
  }

  .news-list .news-card .news-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
  }
}

.news-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-md);
}

@supports not (border-color: color-mix(in srgb, red, blue)) {
  .news-card:hover {
    border-color: var(--accent-mid);
  }
}

.news-card-media {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-muted);
  aspect-ratio: 16 / 10;
}

.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.news-card:hover .news-card-media img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .news-card:hover .news-card-media img {
    transform: none;
  }
}

/* Index #intelligence: card = image, then title, then lead (overrides news-list .news-card grid) */
#intelligence .intelligence-grid-news .news-card--intel {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  align-items: stretch;
}

@media (min-width: 768px) {
  #intelligence .intelligence-grid-news .news-card--intel {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }
}

#intelligence .intelligence-grid-news .news-card--intel .news-card-media {
  margin: 0;
  border-radius: 0;
  aspect-ratio: 16 / 10;
}

#intelligence .intelligence-grid-news .news-card--intel .intelligence-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;
  min-width: 0;
}

#intelligence .intelligence-grid-news .news-card--intel h3 {
  margin: 0;
  font-size: 1.125rem;
  order: 0;
}

#intelligence .intelligence-grid-news .news-card--intel h3 a {
  color: var(--text);
  text-decoration: none;
}

#intelligence .intelligence-grid-news .news-card--intel h3 a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

#intelligence .intelligence-grid-news .news-card--intel .intelligence-card-lead {
  margin: 0.65rem 0 0;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
}

#intelligence .intelligence-grid-news .news-card--intel .news-meta {
  margin: 1rem 0 0;
}

#intelligence .intelligence-grid-news .news-card--intel .news-footer {
  margin-top: 0.75rem;
}

.news-card-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.news-card-meta time {
  font-weight: 500;
}

.news-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

html[data-theme="dark"] .news-tag {
  color: var(--accent);
}

.news-card-body h2 {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-display);
  line-height: 1.3;
}

.news-card-body h2 a {
  color: var(--text);
  text-decoration: none;
}

.news-card-body h2 a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.news-card-body > p {
  margin: 0.65rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.news-card-body .link-cta {
  margin-top: 0.85rem;
}

.news-pagination {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.875rem;
}

.news-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

a.news-page-link:hover {
  border-color: var(--accent-mid);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.news-page-link.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

html[data-theme="dark"] .news-page-link.is-current {
  color: var(--accent);
}

.news-page-link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Product list pagination: match reference square style exactly */
.news-pagination--catalog {
  gap: 0.45rem;
  margin-top: 1.6rem;
}

.news-pagination--catalog .news-page-link,
.news-pagination--catalog > a:not(.news-page-link),
.news-pagination--catalog > span:not(.news-page-total),
.news-pagination--catalog > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.35rem;
  padding: 0 0.45rem;
  border-radius: 0;
  border: 1px solid color-mix(in srgb, var(--border) 85%, #d8dee5);
  background: #fff;
  color: #6b7280;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.news-pagination--catalog .news-page-link:hover,
.news-pagination--catalog > a:not(.news-page-link):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.news-pagination--catalog .is-current-page,
.news-pagination--catalog .news-page-link.is-current,
.news-pagination--catalog > a.active,
.news-pagination--catalog > a.current,
.news-pagination--catalog > a[aria-current="page"] {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #fff !important;
}

.news-pagination--catalog .news-page-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.8rem;
  height: 2.35rem;
  padding: 0 0.5rem;
  border: 1px solid color-mix(in srgb, var(--border) 85%, #d8dee5);
  border-radius: 0;
  background: #fff;
  color: #7b8088;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

/* News article detail (news.html) */
.news-detail {
  padding: 0;
  border-bottom: none;
}

.news-breadcrumb {
  margin: 0 0 1.25rem;
}

.news-breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-soft);
}

.news-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.news-breadcrumb li:not(:last-child)::after {
  content: "/";
  color: var(--text-soft);
  opacity: 0.65;
  pointer-events: none;
}

.news-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.news-breadcrumb a:hover {
  text-decoration: underline;
}

.news-breadcrumb [aria-current="page"] {
  color: var(--text-muted);
  font-weight: 500;
  max-width: min(100%, 28rem);
}

.news-breadcrumb-current {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  max-width: 100%;
}

.news-detail-header {
  max-width: 44rem;
  margin-bottom: 1.75rem;
}

.news-detail-kicker {
  margin: 0 0 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.news-detail-title {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.news-detail-meta {
  margin: 0.85rem 0 0;
  font-size: 0.875rem;
  color: var(--text-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.news-detail-reading {
  color: var(--text-soft);
}

.news-detail-lead {
  margin: 1.15rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.news-article-cover {
  margin: 0 0 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  box-shadow: var(--shadow);
}

.news-article-cover img {
  width: 100%;
  height: auto;
  vertical-align: middle;
  display: block;
}

.news-article-body {
  max-width: 44rem;
}

.news-article-body img,
.news-article-body video,
.news-article-body iframe {
  max-width: 100%;
  height: auto;
}

.news-article-body img,
.news-article-body video {
  display: block;
}

.news-article-body iframe {
  max-height: min(70vh, 36rem);
}

.news-article-body h2 {
  margin: 2rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.3;
}

.news-article-body h2:first-child {
  margin-top: 0;
}

.news-article-body p {
  margin: 0.85rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.news-article-body ul {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.news-article-body li {
  margin: 0.35rem 0;
}

.news-article-note {
  margin-top: 1.75rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.news-detail-attachment {
  margin-top: 1.25rem;
}

.news-detail-footer {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.news-detail-footer .link-cta {
  margin-top: 0;
}

.news-detail-footer .news-detail-back {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.news-detail-footer > .blog-share + .product-detail-prev-next {
  margin-top: 1.75rem;
}

.news-detail-back:hover svg {
  transform: translateX(-4px);
}

/* Blog post (blog.html) — classic blog rhythm + Chem.net tokens */
.blog-page .blog-hero {
  padding-top: clamp(2rem, 5vw, 3.25rem);
  padding-bottom: clamp(1.75rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-white) 55%, transparent) 0%, transparent 100%);
}

html[data-theme="dark"] .blog-page .blog-hero {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-white) 12%, transparent) 0%, transparent 100%);
}

.blog-page .blog-hero-inner {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.blog-page .blog-hero-kicker {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.blog-page .blog-hero-title {
  margin-top: 0.5rem;
}

.blog-page .blog-hero-lead {
  margin-left: auto;
  margin-right: auto;
  max-width: 34rem;
}

.blog-layout .news-with-sidebar-main {
  position: relative;
}

.blog-post {
  position: relative;
}

.blog-post-header {
  max-width: 40rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.blog-post-title {
  font-size: clamp(1.85rem, 4.2vw, 2.6rem);
  line-height: 1.12;
}

.blog-byline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.35rem;
}

.blog-byline-avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-deep);
  background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--gold-soft) 35%, var(--bg-muted)));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

html[data-theme="dark"] .blog-byline-avatar {
  box-shadow: none;
  color: var(--accent);
}

.blog-byline-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.blog-byline-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.blog-byline-role {
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.blog-post-dateline {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.blog-post-updated {
  color: var(--text-soft);
  font-style: italic;
}

.blog-post-dek {
  font-size: 1.125rem;
  line-height: 1.62;
  color: var(--text-muted);
}

.blog-post-cover {
  margin-bottom: 2.25rem;
}

.blog-post-cover-caption {
  margin: 0;
  padding: 0.65rem 1rem 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-soft);
  font-style: italic;
  border-left: 3px solid var(--accent-mid);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}

html[data-theme="dark"] .blog-post-cover-caption {
  background: linear-gradient(90deg, rgba(84, 166, 180, 0.12), transparent);
}

.blog-post-prose {
  max-width: 40rem;
  font-family: Georgia, "Times New Roman", serif;
}

.blog-post-prose h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-top: 2.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

/* First in-article heading only (body is split into .blog-ed-section for semantics) */
.blog-post-prose > .blog-ed-section:first-of-type h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.blog-post-prose p,
.blog-post-prose ul {
  font-size: 1.0625rem;
  line-height: 1.78;
}

.blog-lead-paragraph {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.2rem 1.15rem;
  font-size: 1.125rem !important;
  line-height: 1.72 !important;
  color: var(--text) !important;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset;
}

html[data-theme="dark"] .blog-lead-paragraph {
  box-shadow: none;
}

.blog-pullquote {
  margin: 2rem 0;
  padding: 1.15rem 1.25rem 1.2rem;
  border-left: 4px solid var(--gold);
  background: color-mix(in srgb, var(--gold-soft) 14%, var(--bg-muted));
  border-radius: 0 var(--radius) var(--radius) 0;
}

html[data-theme="dark"] .blog-pullquote {
  background: color-mix(in srgb, var(--gold) 10%, var(--bg-muted));
}

.blog-pullquote p {
  margin: 0;
  font-size: 1.1875rem !important;
  line-height: 1.55 !important;
  font-style: italic;
  color: var(--text) !important;
  font-family: var(--font-display);
}

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
}

.blog-post-tags-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-right: 0.25rem;
}

.blog-inline-tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-hover);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--accent-soft);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.blog-inline-tag:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-white));
  border-color: var(--accent-mid);
  text-decoration: none;
}

.blog-post-note {
  margin-top: 1.75rem;
  font-family: var(--font);
}

.blog-post-endmatter {
  max-width: 40rem;
  margin-top: 2.5rem;
}

.blog-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
}

.blog-share-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.blog-share-socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.blog-share-icon:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.blog-share-icon--x:hover {
  color: #0f1419;
  border-color: rgba(15, 20, 25, 0.25);
  background: var(--surface-hover);
}

.blog-share-icon--facebook:hover {
  color: #1877f2;
  border-color: color-mix(in srgb, #1877f2 35%, var(--border));
  background: color-mix(in srgb, #1877f2 8%, var(--bg-muted));
}

.blog-share-icon--linkedin:hover {
  color: #0a66c2;
  border-color: color-mix(in srgb, #0a66c2 35%, var(--border));
  background: color-mix(in srgb, #0a66c2 8%, var(--bg-muted));
}

.blog-share-icon--whatsapp:hover {
  color: #25d366;
  border-color: color-mix(in srgb, #25d366 35%, var(--border));
  background: color-mix(in srgb, #25d366 8%, var(--bg-muted));
}

.blog-share-icon--reddit:hover {
  color: #ff4500;
  border-color: color-mix(in srgb, #ff4500 35%, var(--border));
  background: color-mix(in srgb, #ff4500 8%, var(--bg-muted));
}

html[data-theme="dark"] .blog-share-icon--x:hover {
  color: #e7e9ea;
}

.blog-author-card {
  display: flex;
  gap: 1rem;
  margin-top: 1.75rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-muted), color-mix(in srgb, var(--bg-white) 88%, var(--bg-muted)));
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .blog-author-card {
  background: linear-gradient(135deg, var(--bg-muted), var(--bg-white));
}

.blog-author-card-avatar {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--bg-white);
  border: 1px solid var(--border);
}

.blog-author-card-name {
  margin: 0 0 0.35rem;
  font-size: 1.0625rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.blog-author-card-bio {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.blog-author-card-meta {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
}

.blog-author-card-meta a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.blog-author-card-meta a:hover {
  text-decoration: underline;
}

/* Member auth pages (login/register) */
.member-auth-page {
  padding: 1.25rem 0 2.5rem;
}

.member-auth-wrap {
  max-width: 34rem;
  margin: 0 auto;
}

.member-auth-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.2rem 1.2rem;
}

.member-auth-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.member-auth-header h1,
.member-auth-panel-title {
  margin: 0;
  font-size: clamp(1.35rem, 1.8vw, 1.65rem);
  line-height: 1.2;
  font-family: var(--font-display);
  color: var(--text);
}

.member-auth-lead {
  margin: 0.6rem 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.member-auth-hero.page-hero {
  --page-hero-image: linear-gradient(145deg, #053038 0%, #0d6b7a 42%, #084854 100%);
  min-height: 12.5rem;
}

.member-auth-hero .hero-inner {
  padding-bottom: 2.5rem;
}

.member-auth-hero-lead {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.member-auth-section {
  padding-top: 0.5rem;
}

.member-auth-layout {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 900px) {
  .member-auth-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
    gap: 2.25rem;
  }
}

.member-auth-aside {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent-soft) 45%, var(--bg-white)), var(--bg-white));
  padding: 1.25rem 1.2rem 1.35rem;
  box-shadow: var(--shadow);
}

.member-auth-aside-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
}

.member-auth-aside ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.member-auth-aside li + li {
  margin-top: 0.45rem;
}

.member-auth-feedback {
  display: block;
  min-height: 0;
}

.member-auth-note--error {
  color: #b91c1c;
}

html[data-theme="dark"] .member-auth-note--error {
  color: #fca5a5;
}

.member-auth-note--ok {
  color: var(--accent);
}

.member-auth-form .form-control.is-invalid {
  border-color: #b91c1c;
}

.member-auth-form .form-control.is-valid {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.member-auth-extra-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.member-auth-extra-links a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.member-auth-extra-links a:hover {
  text-decoration: underline;
}

/* Member center (ucenter, sidebar, comments) */
.member-center-body {
  min-height: 100vh;
}

.member-center-page {
  padding-bottom: 2.5rem;
}

.member-center-hero.page-hero {
  --page-hero-image: linear-gradient(145deg, #053038 0%, #0d6b7a 42%, #084854 100%);
  min-height: 12rem;
}

.member-center-section {
  padding-top: 0.35rem;
}

.member-pages-wrap {
  padding-bottom: 2.5rem;
}

.member-center-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .member-center-layout {
    grid-template-columns: minmax(0, 14.5rem) minmax(0, 1fr);
    gap: 2rem;
  }
}

.member-sidebar {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  padding: 0.65rem;
}

.member-sidebar-user {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0.5rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.member-sidebar-avatar {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  box-shadow: var(--shadow);
  background: var(--bg-muted);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.member-sidebar-avatar:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow), 0 0 0 3px var(--accent-ring);
}

.member-sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.member-sidebar-link {
  display: block;
  padding: 0.58rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.member-sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.member-sidebar-link.is-active,
.member-sidebar-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.member-sidebar-link--danger {
  color: #b91c1c;
}

html[data-theme="dark"] .member-sidebar-link--danger {
  color: #fca5a5;
}

.member-sidebar-link--danger:hover {
  background: color-mix(in srgb, #b91c1c 12%, transparent);
  color: #fecaca;
}

.member-center-main {
  min-width: 0;
}

.member-profile-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.2rem 1.4rem;
}

@media (min-width: 768px) {
  .member-profile-card {
    padding: 1.5rem 1.5rem 1.65rem;
  }
}

.member-profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.member-profile-header h2 {
  margin: 0;
  font-size: 1.22rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.member-profile-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--primary-btn-border);
  background: var(--primary-btn-fill);
  color: var(--on-accent);
  box-shadow: var(--primary-btn-shadow);
  transition: background 0.2s ease, transform 0.15s ease;
}

.member-profile-edit-btn:hover {
  background: var(--primary-btn-fill-hover);
  color: var(--on-accent);
}

.member-profile-dl {
  margin: 0;
}

.member-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 0.65rem 1.25rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}

.member-profile-row:last-child {
  border-bottom: none;
}

@media (max-width: 560px) {
  .member-profile-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

.member-profile-row dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
}

.member-profile-row dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  word-break: break-word;
}

.member-profile-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid var(--border);
}

.member-umodify-card .form-group {
  margin-bottom: 1rem;
}

.member-umodify-card label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
}

.member-umodify-card .form-control {
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.72rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text);
  font-size: 0.93rem;
  box-sizing: border-box;
}

.member-umodify-card .form-control:focus {
  outline: none;
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.member-umodify-card select.form-control {
  max-width: 12rem;
}

.member-umodify-readonly {
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.15rem 0;
}

.member-umodify-avatar-wrap {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 0.65rem;
  background: var(--bg-muted);
}

.member-umodify-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-upload-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg-white));
  color: var(--accent-hover);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.member-upload-trigger:hover {
  background: var(--accent-soft);
  border-color: var(--accent-mid);
}

.member-umodify-dob {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  max-width: 28rem;
}

.member-umodify-card .member-umodify-dob select.form-control {
  flex: 1 1 0;
  min-width: 5rem;
  max-width: none;
}

.member-umodify-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.member-umodify-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.35rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--primary-btn-border);
  background: var(--primary-btn-fill);
  color: var(--on-accent);
  box-shadow: var(--primary-btn-shadow);
  transition: background 0.2s ease, transform 0.15s ease;
  width: auto;
}

.member-umodify-save:hover {
  background: var(--primary-btn-fill-hover);
}

.member-profile-back-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.member-profile-back-link:hover {
  text-decoration: underline;
}

.member-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.member-feedback-modal[hidden] {
  display: none !important;
}

.member-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 21, 32, 0.5);
  backdrop-filter: blur(3px);
}

.member-feedback-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 27rem);
  padding: 1.2rem 1.2rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
}

.member-feedback-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-soft);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.member-feedback-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.member-feedback-icon {
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-white));
  color: var(--accent-hover);
  font-weight: 800;
  font-size: 1.2rem;
}

.member-feedback-icon.is-error {
  background: color-mix(in srgb, #fca5a5 40%, var(--bg-white));
  color: #b91c1c;
}

.member-feedback-title {
  margin: 0.7rem 0 0;
  font-size: 1.08rem;
  font-family: var(--font-display);
  color: var(--text);
}

.member-feedback-message {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.member-feedback-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.member-feedback-ok {
  min-width: 7rem;
}

body.member-feedback-open {
  overflow: hidden;
}

.subscribe-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.subscribe-feedback-modal[hidden] {
  display: none !important;
}

.subscribe-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 21, 32, 0.5);
  backdrop-filter: blur(3px);
}

.subscribe-feedback-dialog {
  position: relative;
  z-index: 2147483647;
  width: min(100%, 27rem);
  padding: 1.2rem 1.2rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
}

.subscribe-feedback-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-soft);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.subscribe-feedback-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.subscribe-feedback-icon {
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-white));
  color: var(--accent-hover);
  font-weight: 800;
  font-size: 1.2rem;
}

.subscribe-feedback-icon.is-error {
  background: color-mix(in srgb, #fca5a5 40%, var(--bg-white));
  color: #b91c1c;
}

.subscribe-feedback-title {
  margin: 0.7rem 0 0;
  font-size: 1.08rem;
  font-family: var(--font-display);
  color: var(--text);
}

.subscribe-feedback-message {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.subscribe-feedback-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.subscribe-feedback-ok {
  min-width: 7rem;
}

body.subscribe-feedback-open {
  overflow: hidden;
}

.contact-feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 10980;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.contact-feedback-modal[hidden] {
  display: none !important;
}

.contact-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 21, 32, 0.5);
  backdrop-filter: blur(3px);
}

.contact-feedback-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 27rem);
  padding: 1.2rem 1.2rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
}

.contact-feedback-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-soft);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.contact-feedback-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.contact-feedback-icon {
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-white));
  color: var(--accent-hover);
  font-weight: 800;
  font-size: 1.2rem;
}

.contact-feedback-icon.is-error {
  background: color-mix(in srgb, #fca5a5 40%, var(--bg-white));
  color: #b91c1c;
}

.contact-feedback-title {
  margin: 0.7rem 0 0;
  font-size: 1.08rem;
  font-family: var(--font-display);
  color: var(--text);
}

.contact-feedback-message {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.contact-feedback-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.contact-feedback-ok {
  min-width: 7rem;
}

body.contact-feedback-open {
  overflow: hidden;
}

/* Single-image upload popup (comm/upload-image.html) — fixed overlay, no Bootstrap modal JS */
.chem-upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.chem-upload-overlay.is-open {
  display: flex;
}

.chem-upload-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 21, 32, 0.5);
  cursor: pointer;
}

.chem-upload-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  max-height: min(90vh, 36rem);
  overflow: auto;
  pointer-events: auto;
}

.chem-upload-overlay .chem-upload-content {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chem-upload-overlay .chem-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 35%, var(--bg-white)), var(--bg-white));
}

.chem-upload-overlay .chem-upload-title {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.chem-upload-overlay .chem-upload-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-soft);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chem-upload-overlay .chem-upload-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.chem-upload-overlay .chem-upload-body {
  padding: 1rem 1.1rem 1.15rem;
}

.chem-upload-overlay .chem-upload-hint {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.chem-upload-overlay .chem-upload-filewrap {
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--bg-muted) 40%, var(--bg-white));
  padding: 0.35rem;
}

.chem-upload-overlay .chem-upload-errors {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: #b91c1c;
}

.chem-upload-overlay .chem-upload-footer {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-page);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.chem-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.product-list-page .news-sidebar-list:not(.news-sidebar-list--compact) a,
body.product-detail-page .news-sidebar-list:not(.news-sidebar-list--compact) a,
body.news-list-page .news-sidebar-list:not(.news-sidebar-list--compact) a,
body.news-detail-page .news-sidebar-list:not(.news-sidebar-list--compact) a,
body.blog-page .news-sidebar-list:not(.news-sidebar-list--compact) a {
  justify-content: flex-start;
  gap: 0.45rem;
}

body.product-list-page .news-sidebar-list:not(.news-sidebar-list--compact) a::before,
body.product-detail-page .news-sidebar-list:not(.news-sidebar-list--compact) a::before,
body.news-list-page .news-sidebar-list:not(.news-sidebar-list--compact) a::before,
body.news-detail-page .news-sidebar-list:not(.news-sidebar-list--compact) a::before,
body.blog-page .news-sidebar-list:not(.news-sidebar-list--compact) a::before {
  content: "›";
  font-size: 0.82em;
  line-height: 1;
  color: currentColor;
  opacity: 0.75;
  flex: 0 0 auto;
}

body.product-list-page .news-sidebar-list:not(.news-sidebar-list--compact) a .news-sidebar-count,
body.product-detail-page .news-sidebar-list:not(.news-sidebar-list--compact) a .news-sidebar-count,
body.news-list-page .news-sidebar-list:not(.news-sidebar-list--compact) a .news-sidebar-count,
body.news-detail-page .news-sidebar-list:not(.news-sidebar-list--compact) a .news-sidebar-count,
body.blog-page .news-sidebar-list:not(.news-sidebar-list--compact) a .news-sidebar-count {
  margin-left: auto;
}

.chem-upload-btn--ghost {
  border-color: var(--border);
  background: var(--bg-white);
  color: var(--text-muted);
}

.chem-upload-btn--ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.chem-upload-btn--primary {
  border-color: var(--primary-btn-border);
  background: var(--primary-btn-fill);
  color: var(--on-accent);
  box-shadow: var(--primary-btn-shadow);
}

.chem-upload-btn--primary:hover {
  background: var(--primary-btn-fill-hover);
}

body.chem-upload-open {
  overflow: hidden;
}

html[data-theme="dark"] .chem-upload-overlay .chem-upload-content {
  background: var(--bg-white);
}

.member-comments-card {
  padding: 0;
  overflow: hidden;
}

.member-comments-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.member-comments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.member-comments-table thead th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--bg-white));
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.member-comments-table tbody td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  vertical-align: top;
  color: var(--text-muted);
}

.member-comments-table tbody tr:last-child td {
  border-bottom: none;
}

.member-comment-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.member-comment-status--ok {
  background: color-mix(in srgb, var(--accent-soft) 80%, transparent);
  color: var(--accent-hover);
}

.member-comment-status--pending {
  background: color-mix(in srgb, #b91c1c 15%, transparent);
  color: #b91c1c;
}

html[data-theme="dark"] .member-comment-status--pending {
  color: #fca5a5;
}

.member-comment-delete {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.member-comment-delete:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
}

.member-comments-pagination {
  margin: 1rem 1rem 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.member-comments-empty {
  margin: 1rem 1.25rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .member-comments-table thead {
    display: none;
  }

  .member-comments-table tbody tr {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .member-comments-table tbody td {
    display: grid;
    grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr);
    gap: 0.35rem 0.75rem;
    padding: 0.35rem 0.75rem;
    border: none;
  }

  .member-comments-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
  }
}

.member-auth-form .member-auth-field {
  margin-bottom: 0.95rem;
}

.member-auth-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
}

.member-auth-form .form-control {
  width: 100%;
  padding: 0.58rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.35;
  box-sizing: border-box;
}

.member-auth-form .form-control:focus {
  outline: none;
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.member-auth-captcha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.member-auth-captcha img {
  height: 2.45rem;
  width: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
}

.member-auth-sendcode {
  border: 1px solid var(--primary-btn-border);
  background: var(--primary-btn-fill);
  color: var(--on-accent);
  padding: 0.58rem 0.82rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow: var(--primary-btn-shadow);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.member-auth-sendcode:hover {
  background: var(--primary-btn-fill-hover);
}

.member-auth-sendcode:active {
  transform: translateY(1px);
}

.member-auth-actions {
  margin-top: 1rem;
}

.member-auth-actions .inquiry-btn-submit {
  width: 100% !important;
  justify-content: center;
}

.member-auth-switch {
  margin: 0.78rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.member-auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.member-auth-switch a:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .member-auth-page {
    padding: 2rem 0 3rem;
  }

  .member-auth-panel {
    padding: 1.8rem 1.8rem 1.55rem;
  }
}

.blog-read-more {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.blog-read-more-title {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.blog-read-more-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .blog-read-more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.blog-teaser {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-teaser:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .blog-teaser:hover {
    transform: none;
  }
}

.blog-teaser-meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.blog-teaser-title {
  font-size: 1.0625rem;
  font-weight: 700;
  font-family: var(--font-display);
  line-height: 1.35;
  color: var(--text);
}

.blog-teaser-excerpt {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.blog-post-footer-nav {
  margin-top: 2rem;
}

.blog-layout .news-sidebar-block {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 12%, var(--border));
}

/* Blog — editorial layout (blog.html, international magazine / Medium-style) */
.blog-ed-page {
  --blog-ed-max: 44rem;
  --blog-ed-gap: clamp(1.5rem, 4vw, 2.75rem);
  background: var(--bg-page);
}

.blog-ed-shell {
  padding: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(2rem, 5vw, 3rem);
}

.blog-ed-layout {
  display: grid;
  gap: var(--blog-ed-gap);
  align-items: start;
}

@media (min-width: 1024px) {
  .blog-ed-layout {
    grid-template-columns: minmax(0, 1fr) 17.5rem;
    gap: 2.5rem;
  }
}

@media (min-width: 1200px) {
  .blog-ed-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }
}

/* Blog sidebar — author profile + latest (blog.html) */
.blog-sidebar-author-card {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.blog-sidebar-cover {
  position: relative;
  height: 5.5rem;
  background-size: cover;
  background-position: center;
}

.blog-sidebar-cover--gradient {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-deep) 88%, #031014) 0%,
    var(--accent) 52%,
    color-mix(in srgb, var(--accent-deep) 78%, var(--gold-soft) 22%) 100%
  );
  opacity: 0.96;
}

.blog-sidebar-cover--gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg-white) 100%);
}

.blog-sidebar-author-body {
  position: relative;
  padding: 0 1rem 1rem;
  margin-top: -2.75rem;
  text-align: center;
}

.blog-sidebar-avatar-stack {
  position: relative;
  display: inline-block;
  margin-bottom: 0.65rem;
}

.blog-sidebar-avatar-img,
.blog-sidebar-avatar-fallback {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  border: 3px solid var(--bg-white);
  box-shadow: 0 6px 20px rgba(12, 21, 32, 0.12);
  object-fit: cover;
  background: var(--bg-muted);
}

.blog-sidebar-avatar-label {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  border: 3px solid var(--bg-white);
  box-shadow: 0 6px 20px rgba(12, 21, 32, 0.12);
  background: var(--bg-muted);
  overflow: hidden;
  padding: 0;
}

.blog-sidebar-avatar-label img,
.blog-sidebar-avatar-label picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-sidebar-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-deep);
  font-family: var(--font-display);
}

.blog-sidebar-crown {
  position: absolute;
  top: -0.2rem;
  left: -0.35rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transform: rotate(-18deg);
}

.blog-sidebar-verified-badge {
  position: absolute;
  right: -0.1rem;
  bottom: 0.15rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #fde68a, #fbbf24);
  border: 2px solid #dc2626;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.blog-sidebar-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.45rem;
}

.blog-sidebar-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.blog-sidebar-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  border-radius: 0.25rem;
  padding: 0.15rem 0.35rem;
  flex-shrink: 0;
}

.blog-sidebar-chip--verify {
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  background: linear-gradient(180deg, #fb923c, #ea580c);
  color: #fff;
  border-radius: 0.2rem;
}

.blog-sidebar-chip--role {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #fff;
  letter-spacing: 0.02em;
}

.blog-sidebar-metrics {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-soft);
  font-weight: 500;
}

.blog-sidebar-metrics-sep {
  margin: 0 0.35rem;
  opacity: 0.65;
}

.blog-sidebar-latest {
  padding: 0 1rem 1.1rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-muted) 35%, var(--bg-white)), var(--bg-white));
}

.blog-sidebar-latest-title {
  position: relative;
  margin: 0;
  padding: 0.85rem 0 0.65rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.blog-sidebar-latest-title::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.blog-sidebar-latest-title-text {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 0.65rem;
  background: var(--bg-white);
  color: var(--accent);
  font-family: var(--font-display);
}

html[data-theme="dark"] .blog-sidebar-latest-title-text {
  background: color-mix(in srgb, var(--bg-white) 92%, #0d141c);
}

.blog-sidebar-latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-sidebar-latest-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.blog-sidebar-latest-item:last-child {
  border-bottom: none;
}

.blog-sidebar-latest-dot {
  width: 0.35rem;
  height: 0.35rem;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.blog-sidebar-latest-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.35;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-sidebar-latest-link:hover {
  color: var(--accent-hover);
}

.blog-sidebar-latest-date {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

html[data-theme="dark"] .blog-sidebar-author-card {
  background: color-mix(in srgb, var(--bg-white) 96%, #0a1016);
  border-color: var(--border);
}

html[data-theme="dark"] .blog-sidebar-avatar-img,
html[data-theme="dark"] .blog-sidebar-avatar-fallback {
  border-color: color-mix(in srgb, var(--bg-white) 96%, #0a1016);
}

.blog-ed-article {
  min-width: 0;
  margin: 0 auto;
  width: 100%;
  max-width: calc(var(--blog-ed-max) + 2rem);
  padding: clamp(1.35rem, 3vw, 2rem) clamp(0.85rem, 2.5vw, 1.35rem);
  border-radius: var(--radius-xl);
  /* Lighter neutral “paper” surface — reads clearly against --bg-page and away from teal masthead */
  background: #fbfbf9;
  border: 1px solid rgba(12, 21, 32, 0.07);
  box-shadow: 0 2px 24px rgba(12, 21, 32, 0.045);
}

html[data-theme="dark"] .blog-ed-article {
  background: color-mix(in srgb, var(--bg-white) 88%, #0d141c);
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.blog-ed-post-head {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.blog-ed-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.blog-ed-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.blog-ed-breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.blog-ed-breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--border);
  font-weight: 400;
}

.blog-ed-breadcrumb li:last-child span {
  color: var(--text);
  font-weight: 500;
}

.blog-ed-category {
  margin: 0 0 0.75rem;
}

.blog-ed-category-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--bg-white));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 999px;
}

.blog-ed-post-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
}

.blog-ed-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.blog-ed-byline-start {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.blog-ed-byline-photo {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Custom label {label:richard} — size inner media like .blog-ed-byline-photo */
.blog-label-avatar--byline {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.blog-label-avatar--byline img,
.blog-label-avatar--byline picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-label-avatar--byline svg {
  width: 100%;
  height: 100%;
  display: block;
}

.blog-ed-byline-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-deep);
  background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--gold-soft) 28%, var(--bg-muted)));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  flex-shrink: 0;
}

.blog-ed-byline-who {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.blog-ed-byline-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.blog-ed-byline-role {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.blog-ed-byline-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}

.blog-ed-inline-author {
  min-width: 0;
}

.blog-ed-inline-author-label {
  font-weight: 600;
  color: var(--text-soft);
  margin-right: 0.2rem;
}

.blog-ed-inline-author-name {
  font-weight: 500;
  color: var(--text-muted);
}

.blog-ed-comments-jump {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.blog-ed-comments-jump:hover {
  text-decoration: underline;
}

.blog-ed-author-spotlight {
  margin: clamp(2rem, 4vw, 2.75rem) auto 0;
  max-width: var(--blog-ed-max);
  padding: 1.35rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-soft) 55%, var(--bg-white)),
    var(--bg-white)
  );
  box-shadow: var(--shadow);
}

.blog-ed-author-spotlight-inner {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}

.blog-ed-author-spotlight-photo {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 12%, transparent);
  flex-shrink: 0;
}

.blog-label-avatar--spotlight {
  flex-shrink: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

.blog-label-avatar--spotlight img,
.blog-label-avatar--spotlight picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-ed-author-spotlight-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-deep);
  background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--gold-soft) 22%, var(--bg-muted)));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  flex-shrink: 0;
}

.blog-ed-author-spotlight-label {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.blog-ed-author-spotlight-name {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
}

.blog-ed-author-spotlight-role {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.blog-ed-author-spotlight-bio {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.blog-ed-author-spotlight-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.blog-ed-author-spotlight-link:hover {
  text-decoration: underline;
}

.blog-ed-comments-wrap {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding-bottom: clamp(1rem, 2vw, 1.75rem);
}

.blog-comments {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.blog-comments-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--text);
}

.blog-comments-lead {
  margin: 0 0 1.75rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.blog-comments-hint {
  margin: -0.75rem 0 1.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-soft);
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--accent) 22%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--bg-page));
}

.blog-comments-subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.blog-comments-form-wrap {
  margin-bottom: 2.25rem;
  padding: 1.25rem 1.2rem 1.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

.blog-comments-textarea,
.blog-comments-input {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  background: var(--bg-page);
  resize: vertical;
  min-height: 6rem;
}

.blog-comments-input {
  min-height: 0;
}

.blog-comments-textarea:focus,
.blog-comments-input:focus {
  outline: 2px solid var(--accent-ring);
  outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.blog-comments-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.blog-comments-captcha {
  margin-top: 1rem;
}

.blog-comments-captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.blog-comments-captcha-row .blog-comments-input {
  flex: 1 1 10rem;
  max-width: 14rem;
}

.blog-comments-codeimg {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
}

.blog-comments-submit {
  margin-top: 1rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--accent-mid), var(--accent));
  cursor: pointer;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent);
}

.blog-comments-submit:hover {
  background: linear-gradient(145deg, var(--accent-hover), var(--accent-mid));
}

.blog-comments-list-wrap {
  margin-top: 0.5rem;
}

.blog-comment-thread + .blog-comment-thread {
  margin-top: 1.25rem;
}

.blog-comment {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.blog-comment--nested {
  margin-top: 1rem;
  padding: 1rem 0 0;
  border-bottom: none;
  border-top: 1px dashed color-mix(in srgb, var(--accent) 15%, var(--border));
}

.blog-comment-avatar img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.blog-comment--nested .blog-comment-avatar img {
  width: 2.25rem;
  height: 2.25rem;
}

.blog-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.blog-comment-name {
  font-size: 0.9rem;
  color: var(--text);
}

.blog-comment-date {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.blog-comment-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.blog-comment-mention {
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.25rem;
}

.blog-comment-reply {
  margin-top: 0.5rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.blog-comment-reply:hover {
  color: var(--accent-hover);
}

.blog-comments-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.blog-comments-page-link {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
}

.blog-comments-page-link:hover {
  border-color: var(--accent-mid);
  color: var(--accent);
}

.blog-comments-empty {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.blog-comment-dialog {
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  max-width: min(32rem, calc(100vw - 2rem));
  box-shadow: var(--shadow-lg);
}

.blog-comment-dialog::backdrop {
  background: rgba(12, 21, 32, 0.45);
}

.blog-comment-dialog-inner {
  padding: 1.25rem 1.25rem 1.35rem;
  background: var(--bg-white);
  color: var(--text);
}

.blog-comment-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.blog-comment-dialog-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.blog-comment-dialog-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
}

.blog-comment-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.blog-comments-cancel {
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  cursor: pointer;
}

.blog-ed-meta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 560px) {
  .blog-ed-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
  }
}

.blog-ed-meta-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blog-ed-meta-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-deep);
  background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--gold-soft) 30%, var(--bg-muted)));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
}

.blog-ed-meta-author-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.blog-ed-meta-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
}

.blog-ed-meta-role {
  font-size: 0.8125rem;
  color: var(--text-soft);
}

.blog-ed-meta-dates {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.blog-ed-meta-dot {
  margin: 0 0.35rem;
  opacity: 0.55;
}

.blog-ed-meta-updated {
  font-style: italic;
  color: var(--text-soft);
}

.blog-ed-lead {
  margin: 1.25rem 0 0;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.blog-ed-dek {
  margin: 1.5rem 0 0;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.65;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.blog-ed-cover {
  margin: 0 0 clamp(1.75rem, 3vw, 2.5rem);
}

.blog-ed-cover-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--accent-deep) 12%, transparent);
  background: var(--bg-muted);
}

.blog-ed-cover-frame img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.blog-ed-cover-cap {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.blog-ed-page .blog-ed-prose {
  max-width: var(--blog-ed-max);
  margin-left: auto;
  margin-right: auto;
}

.blog-ed-footer {
  max-width: var(--blog-ed-max);
  margin-left: auto;
  margin-right: auto;
}

.blog-ed-footer .blog-ed-prev-next {
  margin-top: 2rem;
}

.blog-ed-page .blog-ed-author.blog-author-card {
  margin-top: 1.5rem;
  border-radius: var(--radius-lg);
}

.blog-ed-page .blog-author-card-name {
  font-size: 1rem;
}

.blog-ed-back {
  margin-top: 2rem;
}

.blog-ed-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.blog-ed-back-link:hover {
  text-decoration: underline;
}

.team-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.team-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  padding: 1.35rem 1.1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.team-card-avatar {
  width: 3.75rem;
  height: 3.75rem;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: var(--bg-muted);
  box-shadow: 0 2px 10px rgba(12, 21, 32, 0.1);
}

@supports not (border: 2px solid color-mix(in srgb, red, blue)) {
  .team-card-avatar {
    border: 2px solid var(--accent-soft);
  }
}

.team-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.team-card h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.team-card .team-role {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.team-card p {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Footer — deeper band tinted by current style (accent-deep × page bg) */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  padding: 2rem 0;
}

@supports (background: color-mix(in srgb, red, blue)) {
  .site-footer {
    border-top: 1px solid color-mix(in srgb, var(--accent-deep) 28%, var(--border));
    background: linear-gradient(
      168deg,
      color-mix(in srgb, var(--accent-deep) 22%, var(--bg-page)) 0%,
      color-mix(in srgb, var(--accent-deep) 38%, var(--bg-page)) 48%,
      color-mix(in srgb, var(--accent-deep) 48%, var(--bg-page)) 100%
    );
}

html[data-theme="dark"] .site-footer {
    border-top: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    background: linear-gradient(
      168deg,
      color-mix(in srgb, var(--accent-deep) 18%, color-mix(in srgb, var(--bg-page) 88%, #030508)) 0%,
      color-mix(in srgb, var(--accent-deep) 28%, color-mix(in srgb, var(--bg-page) 76%, #030508)) 52%,
      color-mix(in srgb, var(--accent-deep) 36%, color-mix(in srgb, var(--bg-page) 68%, #000000)) 100%
    );
  }
}

@media (min-width: 640px) {
  .site-footer {
    padding: 3rem 0;
  }
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-brand-block {
  max-width: 30rem;
}

.footer-brand-head {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-brand-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}

.footer-brand-icon svg {
  width: 1.22rem;
  height: 1.22rem;
}

.footer-brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.footer-brand-name {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.footer-brand-tagline {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--text-soft);
}

.footer-brand-desc {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.4rem;
}

.footer-col h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

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

.footer-grid > nav.footer-col .footer-link-list a {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-grid > nav.footer-col .footer-link-list a:hover {
  color: var(--text);
  text-decoration: underline;
}

address.footer-contact-list {
  font-style: normal;
}

.footer-contact-list p {
  margin: 0.62rem 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.footer-contact-list strong {
  color: var(--text);
  font-weight: 600;
}

.footer-contact-list a {
  display: inline;
  margin: 0;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
}

.footer-contact-list a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-contact-address {
  display: inline;
}

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}

.footer-friendly-links {
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px dashed color-mix(in srgb, var(--accent) 22%, var(--border));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.footer-friendly-title {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.footer-friendly-links a {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer-friendly-links a:hover {
  color: var(--text);
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.footer-social li {
  margin: 0;
  padding: 0;
}

.footer-social a {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  color: color-mix(in srgb, var(--text) 86%, var(--accent));
  background: color-mix(in srgb, var(--accent-soft) 62%, transparent);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.footer-social a:hover {
  transform: translateY(-1px);
  border-color: var(--accent-mid);
  background: color-mix(in srgb, var(--accent-soft) 78%, transparent);
}

.footer-social svg {
  width: 1rem;
  height: 1rem;
}

.footer-copyright {
  margin: 0;
  text-align: left;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.footer-sitemap-link {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.footer-sitemap-link a {
  color: inherit;
  text-decoration: none;
}

.footer-sitemap-link a:hover {
  color: var(--text-muted);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: minmax(14rem, 1.15fr) minmax(0, 2fr);
    align-items: start;
  }

  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .footer-copyright {
    text-align: right;
  }

  .footer-sitemap-link {
    text-align: right;
  }
}

/* Subscribe band above footer */
.subscribe-band {
  padding: 2.5rem 0 2.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, var(--accent-mid) 0%, var(--accent) 55%, var(--accent-deep) 100%);
  color: #f6fbff;
}

@supports (background: color-mix(in srgb, red, blue)) {
  .subscribe-band {
    border-top: 1px solid color-mix(in srgb, var(--accent) 35%, #ffffff);
    border-bottom: 1px solid color-mix(in srgb, var(--accent-deep) 30%, #ffffff);
    background: linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent-mid) 76%, #4fb7ff) 0%,
      color-mix(in srgb, var(--accent) 84%, #3fb0ff) 52%,
      color-mix(in srgb, var(--accent-deep) 90%, #0f4b84) 100%
    );
  }
}

html[data-theme="dark"] .subscribe-band {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-mid) 42%, #0b1118) 0%,
    color-mix(in srgb, var(--accent) 40%, #0a1017) 55%,
    color-mix(in srgb, var(--accent-deep) 44%, #060a10) 100%
  );
}

.subscribe-band-inner {
  text-align: center;
}

.subscribe-band h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.6vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.subscribe-band p {
  margin: 1rem auto 0;
  max-width: 60rem;
  font-size: clamp(0.92rem, 1.35vw, 1.18rem);
  line-height: 1.45;
  color: rgba(246, 251, 255, 0.95);
}

.subscribe-band-form {
  margin: 1.6rem auto 0;
  max-width: 56rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.subscribe-band-form input {
  width: 100%;
  min-height: 3.1rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 0.7rem;
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  color: #1f2a35;
  background: rgba(255, 255, 255, 0.93);
  outline: none;
}

html[data-theme="dark"] .subscribe-band-form input {
  color: #e8f1f8;
  background: rgba(16, 24, 33, 0.88);
  border-color: rgba(132, 170, 197, 0.5);
}

.subscribe-band-form input::placeholder {
  color: #7c8693;
}

html[data-theme="dark"] .subscribe-band-form input::placeholder {
  color: #8ea2b4;
}

.subscribe-band-form input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.subscribe-band-form button {
  min-height: 3.1rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 0.7rem;
  background: #ffffff;
  color: #10528a;
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

html[data-theme="dark"] .subscribe-band-form button {
  background: rgba(232, 241, 248, 0.94);
  color: #123f67;
  border-color: rgba(232, 241, 248, 0.7);
}

.subscribe-band-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(7, 34, 58, 0.2);
}

.subscribe-band small {
  display: block;
  margin-top: 1.05rem;
  font-size: clamp(0.78rem, 1.02vw, 0.92rem);
  color: rgba(245, 250, 255, 0.9);
}

@media (min-width: 900px) {
  .subscribe-band {
    padding: 3.3rem 0 2.8rem;
  }

  .subscribe-band-form {
    grid-template-columns: 1fr 13rem;
    gap: 0.9rem;
  }
}

main {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card:hover,
  .news-card:hover,
  .trial-card:hover {
    transform: none;
  }

  .hero--slider .search-form .btn-dark:hover {
    transform: none;
  }

  .hero-slider-arrow:hover {
    transform: translateY(-50%);
  }

  .link-cta:hover {
    gap: 0.35rem;
  }

  .link-cta:hover svg {
    transform: none;
  }
}

/* Chempages 10 styles — names match aaa.html (classic = default :root, no data-style) */

body[data-style="sky"] {
  --text: #0d2030;
  --text-muted: #26485f;
  --text-soft: #26485f;
  --accent: #2a8fb8;
  --accent-deep: #1d6d8e;
  --accent-hover: #1d6d8e;
  --accent-mid: #2a8fb8;
  --accent-soft: rgba(42, 143, 184, 0.14);
  --accent-ring: rgba(42, 143, 184, 0.35);
  --gold: #6fbad5;
  --gold-soft: #bde7f6;
  --border: rgba(25, 77, 108, 0.2);
  --bg-page: #e9f5fb;
  --bg-white: #ffffff;
  --bg-muted: rgba(42, 143, 184, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(42, 143, 184, 0.1);
  --surface-active: rgba(42, 143, 184, 0.2);
  --theme-color-meta: #1d6d8e;
  --sheet-bg: linear-gradient(135deg, #fafdff 0%, #edf7fd 52%, #e7f3fb 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.55);
  --sheet-shadow: 0 10px 34px rgba(24, 84, 114, 0.22);
  --bg-grad-base: linear-gradient(165deg, #e9f5fb 0%, #e9f5fb 55%, #e9f5fb 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(42, 143, 184, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(29, 109, 142, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(42, 143, 184, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(29, 109, 142, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="sky"] {
  --text: #e6f4fb;
  --text-muted: #c0deec;
  --text-soft: #c0deec;
  --accent: #79c0dc;
  --accent-deep: #4aa2c5;
  --accent-hover: #79c0dc;
  --accent-mid: #79c0dc;
  --accent-soft: rgba(121, 192, 220, 0.14);
  --accent-ring: rgba(121, 192, 220, 0.35);
  --gold: #8ccce3;
  --gold-soft: #65aec8;
  --border: rgba(145, 202, 226, 0.22);
  --bg-page: #0f2431;
  --bg-white: #1f2a35;
  --bg-muted: rgba(121, 192, 220, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(121, 192, 220, 0.14);
  --surface-active: rgba(121, 192, 220, 0.24);
  --theme-color-meta: #0f2431;
  --sheet-bg: linear-gradient(135deg, #163343 0%, #122c3b 52%, #173847 100%);
  --sheet-border: 1px solid rgba(173, 216, 235, 0.2);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #0f2431 0%, #0f2431 55%, #0f2431 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(121, 192, 220, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(74, 162, 197, 0.1) 0%, transparent 52%);
}


body[data-style="mint"] {
  --text: #12352d;
  --text-muted: #2b5a50;
  --text-soft: #2b5a50;
  --accent: #2b9d87;
  --accent-deep: #1f7766;
  --accent-hover: #1f7766;
  --accent-mid: #2b9d87;
  --accent-soft: rgba(43, 157, 135, 0.14);
  --accent-ring: rgba(43, 157, 135, 0.35);
  --gold: #74cdb9;
  --gold-soft: #bfeee3;
  --border: rgba(31, 92, 78, 0.2);
  --bg-page: #eaf8f4;
  --bg-white: #ffffff;
  --bg-muted: rgba(43, 157, 135, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(43, 157, 135, 0.1);
  --surface-active: rgba(43, 157, 135, 0.2);
  --theme-color-meta: #1f7766;
  --sheet-bg: linear-gradient(135deg, #fbfffd 0%, #edf9f5 52%, #e8f5f1 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.58);
  --sheet-shadow: 0 10px 34px rgba(26, 101, 84, 0.2);
  --bg-grad-base: linear-gradient(165deg, #eaf8f4 0%, #eaf8f4 55%, #eaf8f4 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(43, 157, 135, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(31, 119, 102, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(43, 157, 135, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(31, 119, 102, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="mint"] {
  --text: #e3f7f1;
  --text-muted: #b7ddd2;
  --text-soft: #b7ddd2;
  --accent: #73cdb8;
  --accent-deep: #3ca890;
  --accent-hover: #73cdb8;
  --accent-mid: #73cdb8;
  --accent-soft: rgba(115, 205, 184, 0.14);
  --accent-ring: rgba(115, 205, 184, 0.35);
  --gold: #91dcca;
  --gold-soft: #5db69f;
  --border: rgba(140, 209, 190, 0.2);
  --bg-page: #102c27;
  --bg-white: #1f2a35;
  --bg-muted: rgba(115, 205, 184, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(115, 205, 184, 0.14);
  --surface-active: rgba(115, 205, 184, 0.24);
  --theme-color-meta: #102c27;
  --sheet-bg: linear-gradient(135deg, #193d36 0%, #16342f 52%, #1a4039 100%);
  --sheet-border: 1px solid rgba(164, 225, 209, 0.2);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.62);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #102c27 0%, #102c27 55%, #102c27 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(115, 205, 184, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(60, 168, 144, 0.1) 0%, transparent 52%);
}


body[data-style="sunset"] {
  --text: #3f1f17;
  --text-muted: #6a3a2c;
  --text-soft: #6a3a2c;
  --accent: #d26b3b;
  --accent-deep: #aa4f27;
  --accent-hover: #aa4f27;
  --accent-mid: #d26b3b;
  --accent-soft: rgba(210, 107, 59, 0.14);
  --accent-ring: rgba(210, 107, 59, 0.35);
  --gold: #e29d53;
  --gold-soft: #f4d0a6;
  --border: rgba(108, 58, 41, 0.2);
  --bg-page: #fff2e8;
  --bg-white: #ffffff;
  --bg-muted: rgba(210, 107, 59, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(210, 107, 59, 0.1);
  --surface-active: rgba(210, 107, 59, 0.2);
  --theme-color-meta: #aa4f27;
  --sheet-bg: linear-gradient(135deg, #fffaf5 0%, #fff1e5 52%, #ffe9d8 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.6);
  --sheet-shadow: 0 10px 34px rgba(132, 71, 46, 0.2);
  --bg-grad-base: linear-gradient(165deg, #fff2e8 0%, #fff2e8 55%, #fff2e8 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(210, 107, 59, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(170, 79, 39, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(210, 107, 59, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(170, 79, 39, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="sunset"] {
  --text: #ffe9dd;
  --text-muted: #f0c3ae;
  --text-soft: #f0c3ae;
  --accent: #f09363;
  --accent-deep: #d36e3c;
  --accent-hover: #f09363;
  --accent-mid: #f09363;
  --accent-soft: rgba(240, 147, 99, 0.14);
  --accent-ring: rgba(240, 147, 99, 0.35);
  --gold: #f5b871;
  --gold-soft: #cc8852;
  --border: rgba(238, 170, 132, 0.22);
  --bg-page: #2a1b17;
  --bg-white: #1f2a35;
  --bg-muted: rgba(240, 147, 99, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(240, 147, 99, 0.14);
  --surface-active: rgba(240, 147, 99, 0.24);
  --theme-color-meta: #2a1b17;
  --sheet-bg: linear-gradient(135deg, #3a2620 0%, #33211c 52%, #412920 100%);
  --sheet-border: 1px solid rgba(255, 192, 150, 0.18);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.64);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #2a1b17 0%, #2a1b17 55%, #2a1b17 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(240, 147, 99, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(211, 110, 60, 0.1) 0%, transparent 52%);
}


body[data-style="lavender"] {
  --text: #2f2346;
  --text-muted: #5a4b77;
  --text-soft: #5a4b77;
  --accent: #8a67c9;
  --accent-deep: #6b4baa;
  --accent-hover: #6b4baa;
  --accent-mid: #8a67c9;
  --accent-soft: rgba(138, 103, 201, 0.14);
  --accent-ring: rgba(138, 103, 201, 0.35);
  --gold: #b394e6;
  --gold-soft: #ddd0f6;
  --border: rgba(86, 63, 132, 0.2);
  --bg-page: #f2ecfb;
  --bg-white: #ffffff;
  --bg-muted: rgba(138, 103, 201, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(138, 103, 201, 0.1);
  --surface-active: rgba(138, 103, 201, 0.2);
  --theme-color-meta: #6b4baa;
  --sheet-bg: linear-gradient(135deg, #fdfbff 0%, #f3eefc 52%, #ece5fa 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.6);
  --sheet-shadow: 0 10px 34px rgba(75, 56, 117, 0.2);
  --bg-grad-base: linear-gradient(165deg, #f2ecfb 0%, #f2ecfb 55%, #f2ecfb 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(138, 103, 201, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(107, 75, 170, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(138, 103, 201, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(107, 75, 170, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="lavender"] {
  --text: #efe7ff;
  --text-muted: #d0c2ef;
  --text-soft: #d0c2ef;
  --accent: #b79be8;
  --accent-deep: #9979d8;
  --accent-hover: #b79be8;
  --accent-mid: #b79be8;
  --accent-soft: rgba(183, 155, 232, 0.14);
  --accent-ring: rgba(183, 155, 232, 0.35);
  --gold: #c8b2ef;
  --gold-soft: #8165bb;
  --border: rgba(184, 160, 232, 0.24);
  --bg-page: #201a2f;
  --bg-white: #1f2a35;
  --bg-muted: rgba(183, 155, 232, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(183, 155, 232, 0.14);
  --surface-active: rgba(183, 155, 232, 0.24);
  --theme-color-meta: #201a2f;
  --sheet-bg: linear-gradient(135deg, #2e2643 0%, #281f39 52%, #342a4b 100%);
  --sheet-border: 1px solid rgba(192, 170, 236, 0.2);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.63);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #201a2f 0%, #201a2f 55%, #201a2f 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(183, 155, 232, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(153, 121, 216, 0.1) 0%, transparent 52%);
}


body[data-style="slate"] {
  --text: #1f2e3d;
  --text-muted: #3d5265;
  --text-soft: #3d5265;
  --accent: #4f7898;
  --accent-deep: #3a5f7d;
  --accent-hover: #3a5f7d;
  --accent-mid: #4f7898;
  --accent-soft: rgba(79, 120, 152, 0.14);
  --accent-ring: rgba(79, 120, 152, 0.35);
  --gold: #7ca1be;
  --gold-soft: #c3d6e5;
  --border: rgba(43, 65, 84, 0.2);
  --bg-page: #ecf2f7;
  --bg-white: #ffffff;
  --bg-muted: rgba(79, 120, 152, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(79, 120, 152, 0.1);
  --surface-active: rgba(79, 120, 152, 0.2);
  --theme-color-meta: #3a5f7d;
  --sheet-bg: linear-gradient(135deg, #fbfdff 0%, #eef3f8 52%, #e7edf4 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.62);
  --sheet-shadow: 0 10px 34px rgba(40, 61, 83, 0.2);
  --bg-grad-base: linear-gradient(165deg, #ecf2f7 0%, #ecf2f7 55%, #ecf2f7 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(79, 120, 152, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(58, 95, 125, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(79, 120, 152, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(58, 95, 125, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="slate"] {
  --text: #e6edf4;
  --text-muted: #bdd0e0;
  --text-soft: #bdd0e0;
  --accent: #8aaec8;
  --accent-deep: #6f93ae;
  --accent-hover: #8aaec8;
  --accent-mid: #8aaec8;
  --accent-soft: rgba(138, 174, 200, 0.14);
  --accent-ring: rgba(138, 174, 200, 0.35);
  --gold: #9ab9d0;
  --gold-soft: #62819a;
  --border: rgba(150, 181, 207, 0.22);
  --bg-page: #182633;
  --bg-white: #1f2a35;
  --bg-muted: rgba(138, 174, 200, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(138, 174, 200, 0.14);
  --surface-active: rgba(138, 174, 200, 0.24);
  --theme-color-meta: #182633;
  --sheet-bg: linear-gradient(135deg, #233544 0%, #1d2d3a 52%, #273a4a 100%);
  --sheet-border: 1px solid rgba(160, 192, 214, 0.2);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.62);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #182633 0%, #182633 55%, #182633 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(138, 174, 200, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(111, 147, 174, 0.1) 0%, transparent 52%);
}


body[data-style="rose"] {
  --text: #4b2230;
  --text-muted: #784558;
  --text-soft: #784558;
  --accent: #c45b81;
  --accent-deep: #9f4368;
  --accent-hover: #9f4368;
  --accent-mid: #c45b81;
  --accent-soft: rgba(196, 91, 129, 0.14);
  --accent-ring: rgba(196, 91, 129, 0.35);
  --gold: #dc85a4;
  --gold-soft: #f3c7d8;
  --border: rgba(111, 53, 74, 0.2);
  --bg-page: #fff0f5;
  --bg-white: #ffffff;
  --bg-muted: rgba(196, 91, 129, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(196, 91, 129, 0.1);
  --surface-active: rgba(196, 91, 129, 0.2);
  --theme-color-meta: #9f4368;
  --sheet-bg: linear-gradient(135deg, #fffafd 0%, #fff0f6 52%, #ffe7f0 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.62);
  --sheet-shadow: 0 10px 34px rgba(115, 54, 77, 0.2);
  --bg-grad-base: linear-gradient(165deg, #fff0f5 0%, #fff0f5 55%, #fff0f5 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(196, 91, 129, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(159, 67, 104, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(196, 91, 129, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(159, 67, 104, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="rose"] {
  --text: #ffe7ef;
  --text-muted: #efbfd0;
  --text-soft: #efbfd0;
  --accent: #e890b0;
  --accent-deep: #cd6f93;
  --accent-hover: #e890b0;
  --accent-mid: #e890b0;
  --accent-soft: rgba(232, 144, 176, 0.14);
  --accent-ring: rgba(232, 144, 176, 0.35);
  --gold: #eea4be;
  --gold-soft: #a45e78;
  --border: rgba(236, 164, 190, 0.22);
  --bg-page: #2a1720;
  --bg-white: #1f2a35;
  --bg-muted: rgba(232, 144, 176, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(232, 144, 176, 0.14);
  --surface-active: rgba(232, 144, 176, 0.24);
  --theme-color-meta: #2a1720;
  --sheet-bg: linear-gradient(135deg, #3b2230 0%, #341d28 52%, #442735 100%);
  --sheet-border: 1px solid rgba(228, 163, 188, 0.2);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.63);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #2a1720 0%, #2a1720 55%, #2a1720 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(232, 144, 176, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(205, 111, 147, 0.1) 0%, transparent 52%);
}


body[data-style="ocean"] {
  --text: #0f2c40;
  --text-muted: #2b5b78;
  --text-soft: #2b5b78;
  --accent: #1d88b7;
  --accent-deep: #14698f;
  --accent-hover: #14698f;
  --accent-mid: #1d88b7;
  --accent-soft: rgba(29, 136, 183, 0.14);
  --accent-ring: rgba(29, 136, 183, 0.35);
  --gold: #4caed6;
  --gold-soft: #b8e3f3;
  --border: rgba(19, 89, 121, 0.2);
  --bg-page: #e8f6fc;
  --bg-white: #ffffff;
  --bg-muted: rgba(29, 136, 183, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(29, 136, 183, 0.1);
  --surface-active: rgba(29, 136, 183, 0.2);
  --theme-color-meta: #14698f;
  --sheet-bg: linear-gradient(135deg, #fbfeff 0%, #eaf7fd 52%, #e2f2fb 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.62);
  --sheet-shadow: 0 10px 34px rgba(19, 90, 122, 0.2);
  --bg-grad-base: linear-gradient(165deg, #e8f6fc 0%, #e8f6fc 55%, #e8f6fc 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(29, 136, 183, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(20, 105, 143, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(29, 136, 183, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(20, 105, 143, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="ocean"] {
  --text: #e4f3fb;
  --text-muted: #b4d8ea;
  --text-soft: #b4d8ea;
  --accent: #6fc1e2;
  --accent-deep: #3ea1c9;
  --accent-hover: #6fc1e2;
  --accent-mid: #6fc1e2;
  --accent-soft: rgba(111, 193, 226, 0.14);
  --accent-ring: rgba(111, 193, 226, 0.35);
  --gold: #87d1ea;
  --gold-soft: #4f97b5;
  --border: rgba(128, 198, 226, 0.22);
  --bg-page: #0f2634;
  --bg-white: #1f2a35;
  --bg-muted: rgba(111, 193, 226, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(111, 193, 226, 0.14);
  --surface-active: rgba(111, 193, 226, 0.24);
  --theme-color-meta: #0f2634;
  --sheet-bg: linear-gradient(135deg, #17384b 0%, #133043 52%, #1a3d51 100%);
  --sheet-border: 1px solid rgba(139, 205, 231, 0.2);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.62);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #0f2634 0%, #0f2634 55%, #0f2634 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(111, 193, 226, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(62, 161, 201, 0.1) 0%, transparent 52%);
}


body[data-style="forest"] {
  --text: #1d3425;
  --text-muted: #3d6248;
  --text-soft: #3d6248;
  --accent: #3f8d5a;
  --accent-deep: #2d6f45;
  --accent-hover: #2d6f45;
  --accent-mid: #3f8d5a;
  --accent-soft: rgba(63, 141, 90, 0.14);
  --accent-ring: rgba(63, 141, 90, 0.35);
  --gold: #6db787;
  --gold-soft: #c7e8d1;
  --border: rgba(48, 98, 69, 0.2);
  --bg-page: #ecf8ef;
  --bg-white: #ffffff;
  --bg-muted: rgba(63, 141, 90, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(63, 141, 90, 0.1);
  --surface-active: rgba(63, 141, 90, 0.2);
  --theme-color-meta: #2d6f45;
  --sheet-bg: linear-gradient(135deg, #fcfffd 0%, #eef8f0 52%, #e6f3e9 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.62);
  --sheet-shadow: 0 10px 34px rgba(45, 102, 66, 0.2);
  --bg-grad-base: linear-gradient(165deg, #ecf8ef 0%, #ecf8ef 55%, #ecf8ef 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(63, 141, 90, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(45, 111, 69, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(63, 141, 90, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(45, 111, 69, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="forest"] {
  --text: #e6f5ea;
  --text-muted: #bddcc8;
  --text-soft: #bddcc8;
  --accent: #82c89b;
  --accent-deep: #56a673;
  --accent-hover: #82c89b;
  --accent-mid: #82c89b;
  --accent-soft: rgba(130, 200, 155, 0.14);
  --accent-ring: rgba(130, 200, 155, 0.35);
  --gold: #98d8ad;
  --gold-soft: #4f8e63;
  --border: rgba(149, 213, 171, 0.22);
  --bg-page: #16271c;
  --bg-white: #1f2a35;
  --bg-muted: rgba(130, 200, 155, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(130, 200, 155, 0.14);
  --surface-active: rgba(130, 200, 155, 0.24);
  --theme-color-meta: #16271c;
  --sheet-bg: linear-gradient(135deg, #22392a 0%, #1d3024 52%, #284130 100%);
  --sheet-border: 1px solid rgba(163, 220, 184, 0.2);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.62);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #16271c 0%, #16271c 55%, #16271c 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(130, 200, 155, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(86, 166, 115, 0.1) 0%, transparent 52%);
}


body[data-style="mono"] {
  --text: #1f1f1f;
  --text-muted: #4f4f4f;
  --text-soft: #4f4f4f;
  --accent: #6a6a6a;
  --accent-deep: #4f4f4f;
  --accent-hover: #4f4f4f;
  --accent-mid: #6a6a6a;
  --accent-soft: rgba(106, 106, 106, 0.14);
  --accent-ring: rgba(106, 106, 106, 0.35);
  --gold: #8c8c8c;
  --gold-soft: #d8d8d8;
  --border: rgba(62, 62, 62, 0.2);
  --bg-page: #f2f2f2;
  --bg-white: #ffffff;
  --bg-muted: rgba(106, 106, 106, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(106, 106, 106, 0.1);
  --surface-active: rgba(106, 106, 106, 0.2);
  --theme-color-meta: #4f4f4f;
  --sheet-bg: linear-gradient(135deg, #ffffff 0%, #f5f5f5 52%, #ededed 100%);
  --sheet-border: 1px solid rgba(255, 255, 255, 0.65);
  --sheet-shadow: 0 10px 34px rgba(50, 50, 50, 0.2);
  --bg-grad-base: linear-gradient(165deg, #f2f2f2 0%, #f2f2f2 55%, #f2f2f2 100%);
  --bg-grad-1: radial-gradient(ellipse 100% 80% at 96% -4%, rgba(106, 106, 106, 0.1) 0%, transparent 55%);
  --bg-grad-2: radial-gradient(ellipse 70% 55% at 4% 100%, rgba(79, 79, 79, 0.08) 0%, transparent 58%);
  --bg-grad-3: radial-gradient(ellipse 60% 45% at 48% 50%, rgba(106, 106, 106, 0.05) 0%, transparent 62%);
  --bg-grad-4: radial-gradient(ellipse 48% 36% at 88% 18%, rgba(79, 79, 79, 0.06) 0%, transparent 48%);
}


html[data-theme="dark"] body[data-style="mono"] {
  --text: #f1f1f1;
  --text-muted: #cccccc;
  --text-soft: #cccccc;
  --accent: #b0b0b0;
  --accent-deep: #8f8f8f;
  --accent-hover: #b0b0b0;
  --accent-mid: #b0b0b0;
  --accent-soft: rgba(176, 176, 176, 0.14);
  --accent-ring: rgba(176, 176, 176, 0.35);
  --gold: #c2c2c2;
  --gold-soft: #7b7b7b;
  --border: rgba(180, 180, 180, 0.22);
  --bg-page: #1a1a1a;
  --bg-white: #1f2a35;
  --bg-muted: rgba(176, 176, 176, 0.12);
  --header-bg: rgba(20, 29, 39, 0.92);
  --surface-hover: rgba(176, 176, 176, 0.14);
  --surface-active: rgba(176, 176, 176, 0.24);
  --theme-color-meta: #1a1a1a;
  --sheet-bg: linear-gradient(135deg, #2a2a2a 0%, #232323 52%, #303030 100%);
  --sheet-border: 1px solid rgba(180, 180, 180, 0.2);
  --sheet-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --bg-grad-d0: linear-gradient(165deg, #1a1a1a 0%, #1a1a1a 55%, #1a1a1a 100%);
  --bg-grad-d1: radial-gradient(ellipse 100% 82% at 94% 0%, rgba(176, 176, 176, 0.14) 0%, transparent 52%);
  --bg-grad-d2: radial-gradient(ellipse 72% 56% at 4% 64%, rgba(40, 55, 68, 0.45) 0%, transparent 56%);
  --bg-grad-d3: radial-gradient(ellipse 62% 48% at 50% 100%, rgba(143, 143, 143, 0.1) 0%, transparent 52%);
}




/* Style button: shows current style; cycles classic → sky → … → mono (same as aaa.html) */
.palette-picker-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
}

.palette-picker-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
}

.palette-picker-btn:active {
  border-color: var(--accent-mid);
  background: var(--surface-active);
}

.floating-assistant {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
  z-index: 999;
}

.chatbot-toggle,
.back-to-top {
  width: 3.2rem;
  height: 3.2rem;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Match primary actions; --accent* come from :root / data-style / dark theme (no color-mix for old iOS) */
  background: linear-gradient(180deg, var(--accent-mid) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--border), 0 1px 0 rgba(255, 255, 255, 0.14) inset;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-toggle {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chatbot-toggle svg,
.back-to-top svg {
  width: 1.62rem;
  height: 1.62rem;
}

.chatbot-toggle:hover,
.back-to-top:hover {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--border), 0 1px 0 rgba(255, 255, 255, 0.16) inset;
}

.back-to-top:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring), 0 16px 30px rgba(0, 0, 0, 0.26), 0 0 0 1px var(--border),
    0 1px 0 rgba(255, 255, 255, 0.16) inset;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

html[data-theme="dark"] .back-to-top {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

html[data-theme="dark"] .chatbot-toggle:hover,
html[data-theme="dark"] .back-to-top:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.14), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

html[data-theme="dark"] .back-to-top:focus-visible {
  box-shadow: 0 0 0 4px var(--accent-ring), 0 16px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.14) inset;
}

.chatbot-panel {
  position: fixed;
  right: 1.15rem;
  bottom: 8.2rem;
  width: min(92vw, 22rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 998;
}

.chatbot-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.chatbot-panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.chatbot-close {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.chatbot-messages {
  max-height: 18rem;
  overflow: auto;
  padding: 0.7rem;
  background: color-mix(in srgb, var(--bg-soft) 55%, var(--bg-white));
}

.chatbot-msg {
  margin: 0 0 0.55rem;
  padding: 0.52rem 0.62rem;
  border-radius: 0.7rem;
  font-size: 0.84rem;
  line-height: 1.4;
}

.chatbot-msg--bot {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.chatbot-msg--user {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-white));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  color: var(--text);
}

.chatbot-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem;
  border-top: 1px solid var(--border);
}

.chatbot-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.5rem 0.58rem;
  background: var(--bg-white);
  color: var(--text);
}

.chatbot-form button {
  border: 1px solid var(--accent-mid);
  border-radius: 0.55rem;
  padding: 0.5rem 0.72rem;
  background: linear-gradient(180deg, var(--accent-mid) 0%, var(--accent) 100%);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chatbot-form button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.chatbot-actions {
  border-top: 1px solid var(--border);
  padding: 0.58rem 0.65rem 0.7rem;
  background: color-mix(in srgb, var(--bg-soft) 52%, var(--bg-white));
}

.chatbot-human-link {
  display: block;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 0.58rem;
  padding: 0.52rem 0.62rem;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent-soft) 88%, var(--bg-white)) 0%,
    color-mix(in srgb, var(--accent-soft) 62%, var(--bg-white)) 100%
  );
  color: color-mix(in srgb, var(--accent-deep) 75%, var(--text));
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.chatbot-human-link:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent-soft) 96%, var(--bg-white)) 0%,
    color-mix(in srgb, var(--accent-soft) 72%, var(--bg-white)) 100%
  );
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 20%, transparent);
  transform: translateY(-1px);
}

.chatbot-human-link:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 76%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 58%, transparent);
}

@media (max-width: 767px) {
  .palette-picker-btn {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .floating-assistant {
    right: 0.85rem;
    bottom: 0.85rem;
    gap: 0.5rem;
  }

  .chatbot-toggle,
  .back-to-top {
    width: 2.8rem;
    height: 2.8rem;
    /* Slightly deeper stops on small screens; still driven by palette --accent* */
    background: linear-gradient(180deg, var(--accent-deep) 0%, var(--accent) 100%);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26), 0 0 0 1px var(--border), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  }

  .chatbot-toggle:hover,
  .back-to-top:hover {
    background: linear-gradient(180deg, var(--accent-mid) 0%, var(--accent-hover) 100%);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border), 0 1px 0 rgba(255, 255, 255, 0.14) inset;
  }

  .back-to-top:focus-visible {
    box-shadow: 0 0 0 4px var(--accent-ring), 0 14px 30px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--border),
      0 1px 0 rgba(255, 255, 255, 0.14) inset;
  }

  html[data-theme="dark"] .back-to-top {
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.14), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
  }

  html[data-theme="dark"] .chatbot-toggle:hover,
  html[data-theme="dark"] .back-to-top:hover {
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.16), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  }

  html[data-theme="dark"] .back-to-top:focus-visible {
    box-shadow: 0 0 0 4px var(--accent-ring), 0 14px 30px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.14),
      0 1px 0 rgba(255, 255, 255, 0.12) inset;
  }

  .chatbot-toggle svg,
  .back-to-top svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .chatbot-panel {
    right: 0.85rem;
    bottom: 7.2rem;
    width: min(94vw, 20rem);
  }
}

/* Prevent flex children from forcing horizontal overflow */
.grid-3,
.grid-4,
.grid-news,
.grid-edu,
.learn-grid {
  min-width: 0;
}

.grid-3 > *,
.grid-4 > *,
.grid-news > *,
.grid-edu > *,
.learn-grid > * {
  min-width: 0;
}

/* Project capability page (project.html) */
.project-lab-grid {
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
}

.project-lab-prose,
.project-lab-aside {
  min-height: 0;
}

.project-lab-prose {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: none;
  height: 100%;
}

.project-lab-aside {
  height: 100%;
}

.project-lab-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-lab-title-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-lab-title-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (min-width: 960px) {
  .project-lab-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr);
    gap: 2rem;
  }
}

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

@media (min-width: 700px) {
  .project-cap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.project-tech-list {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .project-tech-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.project-tech-item {
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  box-shadow: var(--shadow);
}

.project-tech-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
}

.project-tech-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.58rem;
}

.project-tech-icon {
  flex-shrink: 0;
  width: 1.28rem;
  height: 1.28rem;
  margin-top: 0.1rem;
  color: var(--accent);
  opacity: 0.95;
}

.project-tech-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.project-tech-item p {
  margin: 0;
  color: var(--text-muted);
}

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

@media (min-width: 780px) {
  .project-factory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.project-factory-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.15rem;
}

.project-factory-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  font-family: var(--font-display);
}

.project-factory-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.58rem;
}

.project-factory-icon {
  flex-shrink: 0;
  width: 1.28rem;
  height: 1.28rem;
  margin-top: 0.1rem;
  color: var(--accent);
  opacity: 0.95;
}

.project-factory-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.project-factory-card p {
  margin: 0;
  color: var(--text-muted);
}

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

@media (min-width: 900px) {
  .project-assurance {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.project-assurance-item {
  padding: 1.2rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent-soft) 35%, var(--bg-white)), var(--bg-white));
  box-shadow: var(--shadow);
}

.project-assurance-item h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  font-family: var(--font-display);
}

.project-assurance-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.58rem;
}

.project-assurance-icon {
  flex-shrink: 0;
  width: 1.28rem;
  height: 1.28rem;
  margin-top: 0.1rem;
  color: var(--accent);
  opacity: 0.95;
}

.project-assurance-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.project-assurance-item p {
  margin: 0;
  color: var(--text-muted);
}

/* Site search (search.html, search-results.html) */
.search-hero.page-hero {
  --page-hero-image: linear-gradient(145deg, #053038 0%, #0d6b7a 42%, #084854 100%);
}

.search-panel {
  max-width: 52rem;
  margin: 0 auto;
}

.search-panel--results {
  max-width: 56rem;
}

.search-panel-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.search-panel-lead {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.search-panel-form {
  margin-bottom: 0.25rem;
}

.search-results-summary .search-results-query-wrap {
  font-weight: 400;
  color: var(--text-muted);
}

.search-results-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-result-card {
  display: grid;
  grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr);
  gap: 1rem 1.15rem;
  align-items: start;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-white);
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-result-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-md);
}

.search-result-media {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-muted);
}

.search-result-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-body {
  min-width: 0;
}

.search-result-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
}

.search-result-title a {
  display: block;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-result-title a:hover {
  color: var(--accent);
}

.search-result-snippet {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.search-result-cas {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-cta {
  font-size: 0.875rem;
}

.search-results-pagination {
  margin-top: 1.75rem;
}

.search-empty {
  margin-top: 1.75rem;
  padding: 2rem 1.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--bg-muted) 55%, var(--bg-white));
}

.search-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
}

.search-empty-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 560px) {
  .search-result-card {
    grid-template-columns: 1fr;
  }

  .search-result-media {
    max-width: 12rem;
  }
}

/* Compact search results page */
.search-results-strip {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, var(--bg-white)), var(--bg-white));
}

.search-results-strip-inner {
  padding: 1.75rem 0 1.5rem;
}

.search-results-breadcrumb {
  margin-bottom: 0.65rem;
}

.search-results-strip-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
}

.search-results-strip-lead {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.search-results-strip-lead strong {
  color: var(--accent);
  font-weight: 700;
}

.section-tight-top {
  padding-top: 2rem;
}

@media (min-width: 768px) {
  .section-tight-top {
    padding-top: 2.5rem;
  }
}

/* —— Product photo gallery (photo.html) —— */
.photo-hero.page-hero {
  --page-hero-image: radial-gradient(ellipse 85% 70% at 78% 12%, rgba(201, 162, 39, 0.22), transparent 52%),
    radial-gradient(ellipse 60% 50% at 12% 88%, rgba(13, 107, 122, 0.35), transparent 55%),
    linear-gradient(145deg, #052028 0%, #0d6b7a 42%, #063542 100%);
}

.photo-dock {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.75rem;
  max-width: 44rem;
}

.photo-dock-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--accent-soft));
  background: color-mix(in srgb, var(--bg-white) 88%, transparent);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-dock-link:hover,
.photo-dock-link:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  outline: none;
}

.photo-dock-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-mid), var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
}

.photo-dock-icon::after {
  content: "";
  position: absolute;
  inset: 22%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 0.2rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12) inset;
}

.photo-dock-icon--ai {
  background: conic-gradient(from 120deg, #7c5cff, #00c6ff, #7cffc4, #ffd36e, #7c5cff);
  animation: photo-dock-spin 10s linear infinite;
}

.photo-dock-icon--ai::after {
  border-radius: 50%;
  border-style: dashed;
  animation: photo-dock-spin 14s linear infinite reverse;
}

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

@media (prefers-reduced-motion: reduce) {
  .photo-dock-icon--ai,
  .photo-dock-icon--ai::after {
    animation: none;
  }
}

.photo-dock-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.photo-dock-label {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.photo-dock-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.photo-section-head {
  max-width: 46rem;
  margin-bottom: 1.75rem;
}

.photo-section-lead code {
  font-size: 0.85em;
  padding: 0.12em 0.35em;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg-white));
  color: var(--accent-deep);
}

.photo-title-preview {
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
}

.photo-title-preview span {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg-white));
  color: var(--text-muted);
}

html[data-theme="dark"] .photo-section-lead code {
  color: var(--accent);
}

.photo-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
  border: 1px solid var(--border);
}

.photo-section-badge--real {
  background: color-mix(in srgb, var(--bg-muted) 70%, var(--bg-white));
  color: var(--text-muted);
}

.photo-section-badge--ai {
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.15), rgba(0, 198, 255, 0.12));
  color: var(--accent-deep);
  border-color: color-mix(in srgb, #7c5cff 28%, var(--border));
}

html[data-theme="dark"] .photo-section-badge--ai {
  color: var(--text);
}

.photo-page {
  background-color: #a86f58;
  background-image:
    linear-gradient(160deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.04) 24%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(90deg, rgba(68, 43, 34, 0.42) 1.5px, transparent 1.5px),
    linear-gradient(0deg, rgba(68, 43, 34, 0.36) 1.5px, transparent 1.5px),
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.12) 0%, transparent 26%),
    radial-gradient(circle at 84% 78%, rgba(0, 0, 0, 0.18) 0%, transparent 34%),
    repeating-radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0.06) 1px 2px, transparent 2px 4px);
  background-size: 100% 100%, 56px 28px, 56px 28px, 100% 100%, 100% 100%, 12px 12px;
  box-shadow: inset 0 18px 36px rgba(255, 255, 255, 0.09), inset 0 -26px 48px rgba(0, 0, 0, 0.24);
}

.photo-page .section,
.photo-page .section-bg {
  background: transparent;
}

.photo-wall {
  display: grid;
  /* Desktop: exactly 8 equal columns → 8 photos per row */
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 0.32rem;
  margin-top: 0.35rem;
  overflow: visible;
  perspective: 1200px;
  padding: 0.4rem;
  border-radius: var(--radius-xl);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.photo-wall .photo-wall-item {
  grid-column: span 1;
}

.photo-wall-item {
  margin: 0;
  position: relative;
  z-index: 1;
  isolation: isolate;
  transform-style: preserve-3d;
  cursor: grab;
  transition: none;
  touch-action: none;
  will-change: transform;
  align-self: start;
  grid-row: auto !important;
}

.photo-wall-item figcaption {
  display: none;
}

.photo-pin {
  position: absolute;
  top: -1.25rem;
  left: 50%;
  width: 1.95rem;
  height: 2.6rem;
  transform: translateX(-50%) rotate(12deg);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  z-index: 40;
}

.photo-pin-head {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1.12rem;
  height: 1.12rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 25%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.2) 24%, transparent 34%),
    radial-gradient(circle at 45% 42%, #f26a6a 0%, #cb2e2e 55%, #8e1616 100%);
  border: 1px solid rgba(94, 16, 16, 0.65);
  box-shadow:
    inset -1px -2px 4px rgba(57, 8, 8, 0.35),
    0 3px 8px rgba(12, 21, 32, 0.36);
}

.photo-pin-needle {
  position: absolute;
  top: 0.85rem;
  left: 50%;
  width: 2.5px;
  height: 1.45rem;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #f8fcff 0%, #dbe2ea 22%, #a2afbe 68%, #7d8996 100%);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(74, 83, 94, 0.16);
}

.photo-pin.is-falling {
  pointer-events: none;
  animation: photo-pin-drop 0.52s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.photo-wall-item.is-removed {
  pointer-events: none;
}

.photo-wall-item.is-removed .photo-wall-open,
.photo-wall-item.is-removed figcaption {
  opacity: 0;
  transition: opacity 1.1s ease 1.9s;
}

.photo-wall-item.is-removed .photo-wall-open {
  top: 120vh;
  --card-rx: 0deg !important;
  --card-ry: 0deg !important;
  --card-rz: 0deg !important;
  --card-z: 0px !important;
  --card-scale: 1 !important;
  transform: perspective(1200px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateZ(0) scale(1) !important;
  transition: top 2.3s cubic-bezier(0.22, 0.74, 0.2, 1), opacity 1.1s ease 1.9s;
}

.photo-wall-item.is-removed .photo-wall-open img {
  transform: none !important;
  transition: none !important;
  filter: none !important;
}

@keyframes photo-pin-drop {
  0% {
    transform: translateX(-50%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(42px) rotate(95deg);
    opacity: 0;
  }
}

.photo-wall-open {
  display: block;
  position: relative;
  top: 0;
  width: 100%;
  height: auto;
  padding: 0.42rem 0.42rem 1.2rem;
  border: 0;
  border-radius: 0.28rem;
  overflow: hidden;
  background: #f8f6f2;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 12px 26px rgba(12, 21, 32, 0.18),
    0 2px 0 rgba(12, 21, 32, 0.08);
  cursor: grab;
  transition: transform 0.12s linear, box-shadow 0.16s ease, filter 0.16s ease;
  transform-origin: center center;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  --card-rx: 0deg;
  --card-ry: 0deg;
  --card-rz: 0deg;
  --card-z: 0px;
  --card-scale: 1;
  --shine-x: 50%;
  --shine-y: 0%;
  transform: perspective(1200px) rotateX(var(--card-rx)) rotateY(var(--card-ry)) rotateZ(var(--card-rz))
    translateZ(var(--card-z)) scale(var(--card-scale));
}

.photo-wall-open::before {
  content: "";
  position: absolute;
  inset: auto 8% -10%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.34) 0%, rgba(0, 0, 0, 0.06) 62%, transparent 78%);
  filter: blur(10px);
  transform: translateZ(-28px) scale(0.96);
  opacity: 0.62;
  z-index: -1;
  pointer-events: none;
}

.photo-wall-open::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--shine-x) var(--shine-y), rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0) 46%);
  opacity: 0.55;
  transform: translateZ(8px);
  pointer-events: none;
}

.photo-wall-open img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  /* 8 列时单元格较窄，限制高度避免竖图撑破行，仍用 contain 完整显示 */
  max-height: min(42vh, 400px);
  margin-inline: auto;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgba(12, 21, 32, 0.08);
  border-radius: 0.14rem;
  transition: transform 0.12s linear, filter 0.16s ease;
}

.photo-polaroid-note {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.42rem;
  font-family: "Bradley Hand", "Segoe Script", "Comic Sans MS", cursive;
  font-size: 0.72rem;
  line-height: 1;
  color: #4e4a44;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.photo-wall-item:hover,
.photo-wall-item:focus-within {
  z-index: 8;
}

.photo-wall-item.is-dragging {
  cursor: grabbing;
  z-index: 30;
}

.photo-wall-item.is-dragging .photo-wall-open {
  --card-rx: 0deg;
  --card-ry: 0deg;
  --card-rz: 0deg;
  --card-z: 34px;
  --card-scale: 1.06;
  box-shadow: 0 28px 56px rgba(12, 21, 32, 0.4);
  cursor: grabbing;
  transition: none;
}

.photo-wall-item.is-dragging .photo-wall-open img {
  transition: none;
}

.photo-wall.is-dragging-any .photo-wall-item.is-active .photo-wall-open,
.photo-wall.is-dragging-any .photo-wall-item.is-active .photo-wall-open img {
  transform: none;
  filter: none;
  box-shadow: 0 12px 26px rgba(12, 21, 32, 0.18);
}

.photo-wall-item.is-active {
  z-index: 7;
}

.photo-wall-item.is-active .photo-wall-open {
  --card-z: 26px;
  --card-scale: 1.14;
  box-shadow: 0 24px 46px rgba(12, 21, 32, 0.34);
  filter: saturate(1.06);
}

.photo-wall-item.is-active .photo-wall-open img {
  transform: translateZ(10px);
  filter: saturate(1.08) contrast(1.03);
}

.photo-wall-open:hover,
.photo-wall-open:focus-visible {
  --card-rx: 0deg;
  --card-ry: 0deg;
  --card-rz: 0deg;
  --card-z: 30px;
  --card-scale: 1.18;
  box-shadow: 0 28px 52px rgba(12, 21, 32, 0.38);
  filter: saturate(1.04);
  outline: none;
}

.photo-wall-open:hover img,
.photo-wall-open:focus-visible img {
  transform: translateZ(14px);
  filter: saturate(1.06) contrast(1.02);
}

.photo-wall-open:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-ring), 0 18px 36px rgba(12, 21, 32, 0.26);
}

.photo-wall .photo-wall-item:nth-child(odd) .photo-wall-open {
  --card-rx: 7deg;
  --card-ry: -12deg;
  --card-rz: -1.8deg;
}

.photo-wall .photo-wall-item:nth-child(even) .photo-wall-open {
  --card-rx: -7deg;
  --card-ry: 12deg;
  --card-rz: 1.8deg;
}

.photo-wall .photo-wall-item:nth-child(3n) .photo-wall-open {
  --card-rx: 6deg;
  --card-ry: -14deg;
  --card-rz: 0.9deg;
  --card-z: 6px;
}

.photo-wall .photo-wall-item:nth-child(5n) .photo-wall-open {
  --card-rx: -6deg;
  --card-ry: 14deg;
  --card-rz: -0.9deg;
  --card-z: 6px;
}

.photo-wall-open--ai {
  background: #0f1620;
  border: 1px solid color-mix(in srgb, #7c5cff 36%, var(--border));
}

.photo-wall-open--ai:hover,
.photo-wall-open--ai:focus-visible {
  box-shadow: 0 0 0 1px color-mix(in srgb, #7c5cff 45%, transparent), 0 20px 36px rgba(36, 22, 74, 0.42);
}

/* Responsive: only grid density changes; polaroid frame matches desktop (padding, radius, note, pin, shadows) */
@media (max-width: 900px) {
  .photo-wall {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .photo-wall .photo-wall-item {
    grid-column: span 1;
  }
}

@media (max-width: 560px) {
  .photo-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-wall .photo-wall-item {
    grid-column: span 1;
  }
}

.photo-film-wrap {
  margin-top: 0.5rem;
}

.photo-film-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0.85rem 0 0;
}

.photo-film-rail {
  position: relative;
  margin: 0 calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
  padding: 1.35rem 0 1.5rem;
  background: linear-gradient(180deg, #141a1f 0%, #0a0d11 48%, #121820 100%);
  border-block: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.photo-film-perf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0 10px,
    rgba(255, 255, 255, 0.14) 10px 11px,
    rgba(0, 0, 0, 0.35) 11px 22px
  );
  opacity: 0.85;
}

.photo-film-perf--left {
  left: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.photo-film-perf--right {
  right: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.photo-film-scroll {
  display: flex;
  gap: 1.15rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 1.75rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.photo-film-scroll::-webkit-scrollbar {
  height: 8px;
}

.photo-film-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
}

.photo-film-frame {
  flex: 0 0 min(72vw, 320px);
  scroll-snap-align: center;
  margin: 0;
  padding: 0.55rem 0.55rem 0.65rem;
  background: linear-gradient(180deg, #fefefe 0%, #e8ecf0 100%);
  border-radius: 0.35rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
  position: relative;
}

.photo-film-frame::before {
  content: "";
  position: absolute;
  inset: 0.42rem;
  border: 1px dashed rgba(12, 21, 32, 0.12);
  border-radius: 0.2rem;
  pointer-events: none;
}

.photo-film-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  border-radius: 0.15rem;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.photo-film-open img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 700;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
  transition: filter 0.35s ease, transform 0.45s ease;
}

.photo-film-open:hover img,
.photo-film-open:focus-visible img {
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.03);
}

.photo-film-open:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 3px;
}

.photo-film-frame figcaption {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3d4e5f;
  text-align: center;
}

.photo-bento {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(9rem, 11vw);
  margin-top: 0.5rem;
}

.photo-prism {
  margin: 0;
  position: relative;
  perspective: 900px;
}

.photo-prism--a {
  grid-column: 1 / 7;
  grid-row: 1 / 3;
}

.photo-prism--b {
  grid-column: 7 / 13;
  grid-row: 1 / 2;
}

.photo-prism--c {
  grid-column: 7 / 13;
  grid-row: 2 / 3;
}

.photo-prism--d {
  grid-column: 1 / 8;
  grid-row: 3 / 4;
}

.photo-prism--e {
  grid-column: 8 / 13;
  grid-row: 3 / 5;
}

.photo-prism--f {
  grid-column: 1 / 8;
  grid-row: 4 / 5;
}

.photo-prism-open {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  border-radius: 0.25rem;
  background: transparent;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0% 100%);
  transition: transform 0.35s ease;
  transform: rotateY(0deg) rotateX(0deg);
}

.photo-prism-open::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  border-radius: inherit;
  background: conic-gradient(from 220deg, #7c5cff, #00d4ff, #5cffb0, #ffd36e, #ff6cab, #7c5cff);
  opacity: 0.55;
  animation: photo-prism-hue 7s linear infinite;
}

@keyframes photo-prism-hue {
  to {
    filter: hue-rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-prism-open::before {
    animation: none;
    opacity: 0.35;
  }
}

.photo-prism-open img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 11rem;
  clip-path: inherit;
  box-shadow: 0 18px 40px rgba(12, 21, 32, 0.18);
}

.photo-prism--a .photo-prism-open img {
  min-height: 20rem;
}

.photo-prism--d .photo-prism-open img,
.photo-prism--f .photo-prism-open img {
  min-height: 12rem;
}

.photo-prism--e .photo-prism-open img {
  min-height: 20rem;
}

.photo-prism-sheen {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    transparent 35%,
    rgba(255, 255, 255, 0.22) 48%,
    transparent 62%
  );
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.photo-prism-open:hover .photo-prism-sheen,
.photo-prism-open:focus-visible .photo-prism-sheen {
  opacity: 1;
}

.photo-prism-open:hover,
.photo-prism-open:focus-visible {
  transform: rotateY(-4deg) rotateX(2deg) scale(1.02);
  outline: none;
}

.photo-prism-open:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.photo-prism figcaption {
  margin-top: 0.5rem;
  padding-left: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

@media (max-width: 900px) {
  .photo-bento {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(10rem, 28vw);
  }

  .photo-prism--a,
  .photo-prism--b,
  .photo-prism--c,
  .photo-prism--d,
  .photo-prism--e,
  .photo-prism--f {
    grid-column: auto;
    grid-row: auto;
  }

  .photo-prism--a {
    grid-column: 1 / -1;
    grid-row: span 2;
  }

  .photo-prism--d {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .photo-dock {
    grid-template-columns: 1fr;
  }

  .photo-film-frame {
    flex-basis: 82vw;
  }
}

.photo-lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  border: none;
  margin: 0;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
}

.photo-lightbox[open] {
  display: flex;
}

.photo-lightbox::backdrop {
  background: rgba(6, 10, 14, 0.78);
  backdrop-filter: blur(8px);
}

.photo-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  cursor: zoom-out;
}

.photo-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 56rem);
  max-height: min(92vh, 56rem);
  overflow: auto;
  touch-action: pan-y;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 0.75rem;
}

.photo-lightbox-watermark {
  position: absolute;
  inset: 0.75rem;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  color: rgba(255, 255, 255, 0.2);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: grid;
  place-items: center;
  text-align: center;
  transform: rotate(-24deg);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.photo-lightbox-img {
  display: block;
  width: 100%;
  max-height: min(78vh, 48rem);
  object-fit: contain;
  padding: 0.75rem 0.75rem 1.6rem;
  border-radius: 0.3rem;
  background: #f8f6f2;
  border: 1px solid rgba(12, 21, 32, 0.14);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.62) inset,
    0 18px 30px rgba(0, 0, 0, 0.26);
}

.photo-lightbox-caption {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.photo-lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-white) 92%, var(--accent-soft));
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.photo-lightbox-close:hover {
  background: var(--surface-hover);
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-white) 90%, var(--accent-soft));
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.photo-lightbox-prev {
  left: 0.55rem;
}

.photo-lightbox-next {
  right: 0.55rem;
}

.photo-lightbox-nav:hover {
  background: var(--surface-hover);
}
