:root {
  --bg: #08111e;
  --bg-deep: #10203a;
  --surface: rgba(255, 251, 245, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-soft: rgba(246, 239, 228, 0.94);
  --ink: #14233c;
  --ink-soft: #56657d;
  --brand: #ef6b3d;
  --brand-deep: #b83a20;
  --brand-soft: #ffeed9;
  --accent: #54a4c7;
  --accent-deep: #254b73;
  --line: rgba(20, 35, 60, 0.12);
  --line-strong: rgba(20, 35, 60, 0.18);
  --shadow: 0 34px 80px rgba(2, 12, 25, 0.28);
  --shadow-soft: 0 22px 52px rgba(2, 12, 25, 0.18);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --content-width: min(1180px, calc(100% - 28px));
}

.marketplace-page {
  display: grid;
  gap: 24px;
}

.marketplace-hero,
.marketplace-toolbar,
.marketplace-category-panel,
.marketplace-feed-card,
.marketplace-detail-card,
.marketplace-guide-card,
.marketplace-create-card,
.marketplace-deals-card,
.marketplace-stat-card,
.marketplace-deal-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 240, 229, 0.99));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.08);
}

.marketplace-hero::before,
.marketplace-toolbar::before,
.marketplace-category-panel::before,
.marketplace-feed-card::before,
.marketplace-detail-card::before,
.marketplace-guide-card::before,
.marketplace-create-card::before,
.marketplace-deals-card::before,
.marketplace-stat-card::before,
.marketplace-deal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #f4c95d, var(--accent));
}

.marketplace-hero,
.marketplace-toolbar,
.marketplace-category-panel,
.marketplace-feed-card,
.marketplace-detail-card,
.marketplace-guide-card,
.marketplace-create-card,
.marketplace-deals-card,
.marketplace-stat-card,
.marketplace-deal-card {
  padding: 24px;
}

.marketplace-hero {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  background:
    radial-gradient(circle at top right, rgba(84, 164, 199, 0.14), transparent 26%),
    radial-gradient(circle at bottom left, rgba(239, 107, 61, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(247, 240, 229, 0.99));
}

.marketplace-hero-copy p {
  margin-bottom: 0;
}

.marketplace-hero-actions,
.marketplace-card-actions,
.marketplace-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.marketplace-hero-actions,
.marketplace-card-actions {
  margin-top: 18px;
}

.marketplace-stat-grid {
  display: grid;
  gap: 14px;
}

.marketplace-stat-card strong {
  display: block;
  margin: 10px 0 6px;
  color: var(--ink);
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.marketplace-toolbar {
  display: grid;
  gap: 18px;
}

.marketplace-search-form,
.marketplace-form-grid {
  display: grid;
  gap: 14px;
}

.marketplace-search-form {
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(160px, 0.7fr)) auto;
  align-items: end;
}

.marketplace-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketplace-field {
  display: grid;
  gap: 8px;
}

.marketplace-field.is-wide {
  grid-column: 1 / -1;
}

.marketplace-field span {
  color: var(--ink);
  font-weight: 700;
}

.marketplace-field input,
.marketplace-field select,
.marketplace-field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--ink);
}

.marketplace-field textarea {
  min-height: 120px;
  resize: vertical;
}

.marketplace-category-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.marketplace-category-card {
  min-height: 140px;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 18px;
  text-align: left;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(19, 40, 69, 0.98), rgba(38, 75, 115, 0.95));
  box-shadow: 0 18px 34px rgba(5, 17, 31, 0.18);
}

.marketplace-category-card strong {
  display: block;
  margin: 10px 0 6px;
  color: #fff6e8;
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.marketplace-category-card span:last-child {
  color: rgba(255, 246, 232, 0.78);
}

.marketplace-category-card.is-active {
  background: linear-gradient(135deg, var(--brand), #ff9860);
}

.marketplace-content-grid,
.marketplace-builder-grid {
  display: grid;
  gap: 20px;
}

.marketplace-content-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: start;
}

.marketplace-builder-grid {
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.marketplace-section-heading {
  margin-bottom: 16px;
}

.marketplace-section-heading p:last-child,
.marketplace-guide-card p:last-child,
.marketplace-create-card p:last-child,
.marketplace-detail-box p:last-child,
.marketplace-empty p:last-child {
  margin-bottom: 0;
}

.marketplace-listings-grid,
.marketplace-deals-grid {
  display: grid;
  gap: 16px;
}

.marketplace-listing-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.marketplace-listing-card.is-selected {
  border-color: rgba(184, 58, 32, 0.28);
  box-shadow: 0 18px 38px rgba(184, 58, 32, 0.12);
}

.marketplace-card-top,
.marketplace-selected-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.marketplace-price {
  color: var(--brand-deep);
  font-size: 1.1rem;
  line-height: 1.2;
}

.marketplace-mini-badge,
.marketplace-status-badge,
.marketplace-chip,
.marketplace-note-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.marketplace-mini-badge {
  padding: 7px 10px;
  background: rgba(20, 33, 61, 0.08);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.marketplace-mini-badge.is-warm {
  background: rgba(239, 107, 61, 0.12);
  color: var(--brand-deep);
}

.marketplace-mini-badge.is-cool {
  background: rgba(84, 164, 199, 0.14);
  color: var(--accent-deep);
}

.marketplace-chip {
  padding: 8px 12px;
  background: rgba(20, 33, 61, 0.08);
  color: var(--ink);
}

.marketplace-chip.is-soft {
  background: rgba(244, 201, 93, 0.22);
}

.marketplace-status-badge {
  padding: 8px 12px;
}

.marketplace-status-badge.is-pending {
  background: rgba(244, 201, 93, 0.25);
  color: #8a5a00;
}

.marketplace-status-badge.is-ready {
  background: rgba(40, 167, 116, 0.14);
  color: #176744;
}

.marketplace-status-badge.is-done {
  background: rgba(84, 164, 199, 0.18);
  color: #174d74;
}

.marketplace-listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.marketplace-detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 18px 0;
}

.marketplace-detail-box {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(20, 33, 61, 0.04);
}

.marketplace-detail-box strong {
  display: block;
  margin: 6px 0;
}

.marketplace-detail-card {
  position: sticky;
  top: 112px;
}

.marketplace-callout,
.marketplace-deal-summary,
.marketplace-empty {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(20, 33, 61, 0.04);
}

.marketplace-note-box {
  justify-content: flex-start;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(244, 201, 93, 0.16);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
}

.marketplace-deal-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.marketplace-timeline {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.marketplace-timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(20, 33, 61, 0.05);
  color: var(--ink-soft);
}

.marketplace-timeline-item strong {
  color: var(--ink);
  font-size: 0.96rem;
}

@media (max-width: 1040px) {
  .marketplace-hero,
  .marketplace-content-grid,
  .marketplace-builder-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-detail-card {
    position: static;
    top: auto;
  }

  .marketplace-search-form {
    grid-template-columns: 1fr 1fr;
  }

  .marketplace-search-form > button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .marketplace-search-form,
  .marketplace-form-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-field.is-wide {
    grid-column: auto;
  }

  .marketplace-card-top,
  .marketplace-selected-top,
  .marketplace-timeline-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .marketplace-hero,
  .marketplace-toolbar,
  .marketplace-category-panel,
  .marketplace-feed-card,
  .marketplace-detail-card,
  .marketplace-guide-card,
  .marketplace-create-card,
  .marketplace-deals-card,
  .marketplace-stat-card,
  .marketplace-deal-card {
    padding: 20px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 26px 0 80px;
  background:
    radial-gradient(circle at 12% 10%, rgba(244, 201, 93, 0.18), transparent 20%),
    radial-gradient(circle at 84% 14%, rgba(84, 164, 199, 0.2), transparent 24%),
    radial-gradient(circle at 76% 82%, rgba(239, 107, 61, 0.14), transparent 22%),
    linear-gradient(180deg, #06101b 0%, #0b1728 34%, #13243b 100%);
  color: var(--ink);
  font-family: Candara, "Trebuchet MS", "Gill Sans", sans-serif;
  line-height: 1.7;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.42;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 92%);
}

body > header,
body > main,
body > article,
body > footer,
body > section {
  width: var(--content-width);
  margin-inline: auto;
}

header {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(244, 201, 93, 0.3), transparent 24%),
    radial-gradient(circle at bottom left, rgba(84, 164, 199, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(8, 17, 31, 0.98), rgba(18, 38, 64, 0.97) 44%, rgba(37, 75, 115, 0.96));
  color: #fdf8ef;
  box-shadow: var(--shadow);
}

.top-name-bar {
  position: sticky;
  top: 12px;
  z-index: 1200;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  width: var(--content-width);
  margin: 0 auto 18px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(8, 17, 30, 0.82);
  box-shadow: 0 18px 36px rgba(2, 12, 25, 0.2);
  backdrop-filter: blur(18px);
}

.top-name-bar a {
  display: inline-flex;
  align-items: center;
  min-height: auto !important;
  padding: 10px 14px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f8f3e7;
  text-decoration: none;
  font-weight: 700;
  box-shadow: none !important;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.top-name-bar a:hover {
  background: rgba(244, 201, 93, 0.18);
  transform: translateY(-1px);
  border-color: rgba(244, 201, 93, 0.4);
}

.top-name-bar a.is-active {
  background: rgba(239, 107, 61, 0.2);
  border-color: rgba(239, 107, 61, 0.38);
}

.site-top-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 56px 12px 16px;
  background: linear-gradient(90deg, #111827 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.2);
  font-family: Arial, sans-serif;
}

.site-banner-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.site-banner-link {
  color: #fef08a;
  text-decoration: none;
  font-weight: 700;
}

.site-banner-link:hover {
  text-decoration: underline;
}

.site-banner-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.site-banner-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.site-floating-auth {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.site-floating-auth:hover {
  background: #dbeafe;
}

.site-floating-profile {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px);
}

.site-floating-profile:hover {
  background: #ffffff;
  transform: translateY(-2px);
}

.site-floating-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), #f4c95d);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-floating-profile-copy {
  display: grid;
  gap: 2px;
}

.site-floating-profile-copy strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.1;
}

.site-floating-profile-copy span {
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.has-site-banner .site-floating-auth,
body.has-site-banner .site-floating-profile {
  top: 72px;
}

body.nav-open .site-floating-auth,
body.nav-open .site-floating-profile {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 700px) {
  .site-top-banner {
    padding-right: 52px;
  }
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, transparent 58%, rgba(255, 255, 255, 0.03));
  pointer-events: none;
}

header::after {
  content: "";
  position: absolute;
  inset: auto -60px -90px auto;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(239, 107, 61, 0.18) 0%, rgba(239, 107, 61, 0) 68%);
}

header h1 {
  position: relative;
  z-index: 1;
  margin: 20px 0 12px;
  max-width: 10ch;
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

header p {
  position: relative;
  z-index: 1;
  max-width: 58ch;
  margin: 0;
  color: rgba(253, 248, 239, 0.86);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}

header > img:first-of-type {
  position: relative;
  z-index: 1;
  display: block;
  float: none !important;
  width: 84px;
  height: 84px;
  margin: 0 0 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  object-fit: cover;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

#name {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff7df !important;
  font-family: Candara, "Trebuchet MS", "Gill Sans", sans-serif !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

#p,
header > p:last-of-type {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 248, 232, 0.9) !important;
  font-style: normal !important;
  font-family: Candara, "Trebuchet MS", "Gill Sans", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  text-align: left !important;
}

main,
article,
footer {
  position: relative;
  overflow: hidden;
  margin-top: 24px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 240, 229, 0.98));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

main::before,
article::before,
footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #f4c95d, var(--accent));
}

main > *,
article > *,
footer > * {
  position: relative;
  z-index: 1;
}

article {
  animation: rise-in 0.55s ease both;
}

main {
  display: grid;
  gap: 20px;
}

article p,
main p,
footer p,
li {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

h2,
h2#h2,
h2#heading,
#h2,
#heading {
  margin: 0 0 14px;
  padding: 0 !important;
  background: none !important;
  color: var(--ink) !important;
  font-family: Cambria, Georgia, "Times New Roman", serif !important;
  font-size: clamp(1.75rem, 3vw, 2.45rem) !important;
  font-style: normal !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-align: left !important;
}

h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
}

ul,
ol {
  padding-left: 20px;
  margin: 0 0 12px;
}

strong,
b {
  color: var(--ink);
}

img,
video,
iframe,
canvas {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
}

img {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

th,
td {
  padding: 12px 14px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  text-align: left;
}

th {
  background: rgba(194, 84, 45, 0.08);
  color: var(--ink);
}

pre,
code,
kbd {
  font-family: "Courier New", Courier, monospace;
}

code,
kbd {
  padding: 0.18em 0.45em;
  border-radius: 8px;
  background: rgba(20, 33, 61, 0.08);
}

pre {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(180deg, #0d1a2d, #132845);
  color: #f7f2e8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

input,
select,
textarea,
button {
  font: inherit;
}

button,
#open,
#close,
a.button-link,
a#n,
a#nav,
a#yt,
body > a:not(.site-floating-auth):not(.site-banner-link):not(.nav-link),
article a:not(.nav-link),
main a:not(.nav-link),
footer a:not(.nav-link),
.resource-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), #ff9860);
  color: #fff8ee !important;
  font-family: Candara, "Trebuchet MS", "Gill Sans", sans-serif !important;
  font-size: 0.96rem !important;
  font-style: normal !important;
  font-weight: 700 !important;
  line-height: 1.1;
  text-decoration: none !important;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 18px 36px rgba(184, 58, 32, 0.26);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

body > a:not(.site-floating-auth):not(.site-banner-link):not(.nav-link) {
  width: fit-content;
  margin: 16px auto 0;
  float: none !important;
}

button:hover,
#open:hover,
#close:hover,
a.button-link:hover,
a#n:hover,
a#nav:hover,
a#yt:hover,
body > a:not(.site-floating-auth):not(.site-banner-link):not(.nav-link):hover,
article a:not(.nav-link):hover,
main a:not(.nav-link):hover,
footer a:not(.nav-link):hover,
.resource-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 38px rgba(184, 58, 32, 0.3);
}

button:active,
#open:active,
#close:active,
a.button-link:active,
a#n:active,
a#nav:active,
a#yt:active,
body > a:not(.site-floating-auth):not(.site-banner-link):not(.nav-link):active,
article a:not(.nav-link):active,
main a:not(.nav-link):active,
footer a:not(.nav-link):active,
.resource-link:active,
a.nav-link:active {
  transform: scale(0.985);
}

a.button-link.secondary,
.button-link.secondary {
  background: linear-gradient(135deg, rgba(19, 40, 69, 0.96), rgba(38, 75, 115, 0.94));
  border-color: rgba(255, 255, 255, 0.08);
  color: #f8f2e7 !important;
  box-shadow: 0 18px 36px rgba(5, 17, 31, 0.2);
}

a.button-link.secondary:hover,
.button-link.secondary:hover {
  background: linear-gradient(135deg, rgba(25, 50, 82, 0.98), rgba(45, 89, 135, 0.96));
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(244, 201, 93, 0.72);
  outline-offset: 3px;
}

#open {
  position: relative;
  z-index: 2;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(360px, calc(100vw - 26px));
  max-width: 100vw;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  opacity: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 20px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 30px 30px 0;
  background:
    radial-gradient(circle at top right, rgba(244, 201, 93, 0.2), transparent 22%),
    radial-gradient(circle at bottom left, rgba(84, 164, 199, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(6, 12, 23, 0.98), rgba(14, 28, 48, 0.97));
  backdrop-filter: blur(22px);
  pointer-events: none;
  transform: translateX(calc(-100% - 32px));
  box-shadow: 28px 0 56px rgba(2, 12, 25, 0.34);
  transition: transform 0.24s ease, opacity 0.24s ease, visibility 0.24s ease;
  z-index: 2400;
}

nav.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.site-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2390;
  border: 0;
  padding: 0;
  background: rgba(4, 10, 20, 0.54);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.site-nav-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.nav-open {
  overflow: hidden;
}

#close {
  align-self: flex-end;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fef7e7 !important;
  box-shadow: none;
}

a.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 52px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8f3e7 !important;
  font-size: 1rem !important;
  font-style: normal !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

a.nav-link:hover,
a.nav-link.is-active {
  transform: translateX(6px);
  background: rgba(244, 201, 93, 0.14) !important;
  border-color: rgba(244, 201, 93, 0.34);
  color: #fff8ea !important;
}

footer nav:not(#site-nav) {
  position: static;
  inset: auto;
  visibility: visible;
  opacity: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  overflow: visible;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: auto;
}

footer nav:not(#site-nav) a {
  width: auto;
  float: none !important;
}

.page-links,
.hero-actions,
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

main pre,
article pre,
section pre,
.lesson-example-grid,
.lesson-demo {
  display: none;
}

.lesson-result {
  display: none;
  gap: 12px;
  margin: 16px 0 20px;
  padding: 18px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 242, 232, 0.96));
  box-shadow: 0 14px 28px rgba(20, 33, 61, 0.08);
}

.lesson-code {
  display: none;
  gap: 12px;
  margin: 16px 0;
}

.lesson-code > :not(:last-child),
.lesson-result > :not(:last-child) {
  margin-bottom: 12px;
}

.lesson-code pre {
  margin: 0;
}

.lesson-example-controls {
  margin: 16px 0 20px;
}

.lesson-example-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(194, 84, 45, 0.22);
}

.lesson-example-toggle:hover {
  background: var(--brand-deep);
  transform: translateY(-1px);
}

.lesson-code-label,
.lesson-result-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(194, 84, 45, 0.1);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lesson-preview-frame {
  width: 100%;
  min-height: 220px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 16px;
  background: #ffffff;
}

.lesson-result-empty {
  padding: 22px 18px;
  border: 1px dashed rgba(20, 33, 61, 0.18);
  border-radius: 16px;
  background: rgba(20, 33, 61, 0.03);
  color: var(--ink-soft);
  font-weight: 600;
}

.lesson-result > ul,
.lesson-result > ol,
.lesson-result > dl,
.lesson-result > table,
.lesson-result > form,
.lesson-result > iframe,
.lesson-result > img,
.lesson-result > video,
.lesson-result > audio,
.lesson-result > canvas,
.lesson-result > div,
.lesson-result > p,
.lesson-result > button {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(244, 201, 93, 0.16);
  color: #fff1c7;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 62ch;
}

.stat-grid,
.lesson-grid,
.roadmap-grid,
.highlight-grid {
  display: grid;
  gap: 16px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 28px;
}

.stat-card,
.lesson-card,
.roadmap-card,
.feature-panel,
.highlight-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 239, 228, 0.98));
  box-shadow: 0 18px 40px rgba(2, 12, 25, 0.12);
}

.stat-card::before,
.lesson-card::before,
.roadmap-card::before,
.feature-panel::before,
.highlight-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #f4c95d, var(--accent));
}

.stat-card strong,
.lesson-card strong,
.roadmap-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.4rem;
}

.lesson-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.lesson-card h3,
.roadmap-card h3,
.feature-panel h2 {
  margin-bottom: 10px;
}

.lesson-card p,
.roadmap-card p,
.feature-panel p,
.highlight-card p {
  margin-bottom: 16px;
}

.lesson-page {
  gap: 24px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.lesson-page::before {
  display: none;
}

.lesson-course-layout {
  width: var(--content-width);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.lesson-course-layout > main {
  width: 100%;
  margin-top: 0;
}

.lesson-course-sidebar {
  position: sticky;
  top: 18px;
  z-index: 2;
  max-height: calc(100vh - 36px);
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 240, 231, 0.98));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.1);
}

.lesson-course-sidebar-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.lesson-course-sidebar h2,
.lesson-course-sidebar p {
  margin: 0;
}

.lesson-course-sidebar h2 {
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
}

.lesson-course-sidebar p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

.lesson-course-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lesson-course-collapse {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink) !important;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: none;
}

.lesson-course-progress {
  height: 8px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.08);
}

.lesson-course-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #f4c95d, var(--accent));
}

.lesson-course-tree {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-course-tree::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 17px;
  width: 2px;
  background: rgba(20, 33, 61, 0.1);
}

.lesson-course-item {
  position: relative;
}

.lesson-course-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
}

.lesson-course-link:hover,
.lesson-course-item.is-current .lesson-course-link {
  border-color: rgba(37, 75, 115, 0.18);
  background: rgba(84, 164, 199, 0.1);
  transform: none;
}

.lesson-course-number {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.lesson-course-item.is-complete .lesson-course-number {
  border-color: rgba(29, 122, 76, 0.28);
  background: rgba(29, 122, 76, 0.1);
  color: #16633d;
}

.lesson-course-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lesson-course-copy strong,
.lesson-course-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.lesson-course-copy strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.25;
}

.lesson-course-copy small {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.lesson-course-quiz {
  margin: -3px 10px 4px 54px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.lesson-course-sidebar.is-collapsed {
  overflow: visible;
}

.lesson-course-sidebar.is-collapsed .lesson-course-progress,
.lesson-course-sidebar.is-collapsed .lesson-course-tree,
.lesson-course-sidebar.is-collapsed .lesson-course-sidebar-head p {
  display: none;
}

.lesson-hero,
.lesson-section,
.lesson-checkpoint {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 242, 232, 0.98));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.08);
}

.lesson-hero::before,
.lesson-section::before,
.lesson-checkpoint::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #f4c95d, var(--accent));
}

.lesson-hero,
.lesson-section,
.lesson-checkpoint {
  padding: clamp(20px, 3vw, 28px);
}

.lesson-hero {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(84, 164, 199, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(239, 107, 61, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(247, 240, 229, 0.99));
}

.lesson-hero p:last-child,
.lesson-section p:last-child,
.lesson-checkpoint p:last-child {
  margin-bottom: 0;
}

.lesson-topic-list,
.lesson-step-list,
.lesson-example-grid {
  display: grid;
  gap: 12px;
}

.lesson-topic-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-topic-list li,
.lesson-mini-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.lesson-topic-list li {
  font-weight: 800;
}

.lesson-example-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 16px;
}

.lesson-demo {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(20, 33, 61, 0.16);
  background: rgba(255, 255, 255, 0.7);
}

.lesson-example-grid,
.lesson-demo {
  display: none;
}

.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.lesson-page-nav {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  margin: 26px auto 0;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(84, 164, 199, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 242, 232, 0.98));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.08);
  overflow: hidden;
}

.lesson-page-nav::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #f4c95d, var(--accent));
}

.lesson-page-nav a {
  width: min(100%, 320px);
  min-width: 0;
  min-height: 56px;
  text-align: left;
}

.lesson-page-nav .lesson-nav-prev {
  justify-self: start;
}

.lesson-page-nav .lesson-nav-next {
  justify-self: end;
  text-align: right;
}

@media (max-width: 680px) {
  .lesson-page-nav {
    grid-template-columns: 1fr;
  }

  .lesson-page-nav a {
    width: 100%;
  }

  .lesson-page-nav .lesson-nav-prev,
  .lesson-page-nav .lesson-nav-next {
    justify-self: stretch;
    text-align: center;
  }
}

.lesson-quiz-shell {
  margin: 24px auto;
  padding: 20px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 240, 231, 0.96));
  box-shadow: 0 16px 34px rgba(20, 33, 61, 0.08);
  color: var(--ink);
}

.lesson-quiz-shell h2,
.lesson-quiz-shell h3,
.lesson-quiz-shell p,
.lesson-quiz-shell label {
  color: var(--ink);
}

.lesson-quiz-summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.lesson-quiz-head {
  display: grid;
  gap: 8px;
}

.lesson-quiz-head h2,
.lesson-quiz-head p {
  margin: 0;
}

.lesson-quiz-head h2 {
  padding: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1.35rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.lesson-quiz-head p {
  font-family: inherit;
  font-size: 1rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
}

.lesson-quiz-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(239, 107, 61, 0.1);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-quiz-toggle {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(37, 75, 115, 0.18);
}

.lesson-quiz-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
}

.lesson-quiz-panel {
  margin-top: 18px;
}

.lesson-quiz-panel[hidden] {
  display: none;
}

.lesson-quiz-grid {
  display: grid;
  gap: 16px;
}

.lesson-quiz-question {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  background: #fffdf8;
}

.lesson-quiz-question h3 {
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1.04rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}

.lesson-quiz-options {
  display: grid;
  gap: 10px;
}

.lesson-quiz-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  background: #fff;
  cursor: pointer;
}

.lesson-quiz-option input {
  margin-top: 4px;
}

.lesson-quiz-option.is-correct {
  border-color: rgba(29, 122, 76, 0.34);
  background: rgba(29, 122, 76, 0.08);
}

.lesson-quiz-option.is-incorrect {
  border-color: rgba(180, 56, 46, 0.34);
  background: rgba(180, 56, 46, 0.08);
}

.lesson-quiz-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(20, 33, 61, 0.05);
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.lesson-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.lesson-quiz-button,
.lesson-quiz-reset {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.lesson-quiz-button {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
}

.lesson-quiz-reset {
  background: #e5e7eb;
  color: var(--ink);
}

.lesson-quiz-score {
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 700px) {
  .lesson-quiz-shell {
    padding: 16px;
    border-radius: 18px;
  }

  .lesson-quiz-summary {
    display: grid;
  }

  .lesson-quiz-toggle,
  .lesson-quiz-button,
  .lesson-quiz-reset {
    width: 100%;
  }

  .lesson-quiz-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.label {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  margin-bottom: 12px;
  border-radius: 999px;
  border: 1px solid rgba(239, 107, 61, 0.12);
  background: rgba(239, 107, 61, 0.1);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-layout {
  gap: 28px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.home-layout::before {
  display: none;
}

.home-spotlight,
.home-section-intro {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.home-spotlight {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(244, 201, 93, 0.26), transparent 24%),
    radial-gradient(circle at bottom left, rgba(84, 164, 199, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(8, 17, 31, 0.98), rgba(19, 40, 69, 0.96) 54%, rgba(36, 75, 115, 0.96));
  box-shadow: var(--shadow);
}

.home-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 34%);
  pointer-events: none;
}

.home-spotlight > * {
  position: relative;
  z-index: 1;
}

.home-spotlight h2 {
  margin-bottom: 14px;
  color: #fffdf8 !important;
  font-size: clamp(2.1rem, 5vw, 4rem) !important;
  max-width: 11ch;
}

.home-spotlight p {
  color: rgba(255, 248, 238, 0.84) !important;
}

.home-section-intro {
  display: grid;
  gap: 8px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 239, 228, 0.96));
  box-shadow: var(--shadow-soft);
}

.home-section-intro::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #7fd7de, var(--brand));
}

.home-action-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.home-action-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 100%;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(244, 201, 93, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(10, 24, 43, 0.98), rgba(24, 48, 79, 0.96));
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.home-action-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #f4c95d, var(--accent));
}

.home-action-card:nth-child(3n + 2)::before {
  background: linear-gradient(90deg, var(--accent), #8ad8df, #f4c95d);
}

.home-action-card:nth-child(3n)::before {
  background: linear-gradient(90deg, #f4c95d, var(--brand), var(--accent));
}

.home-action-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 58px rgba(2, 12, 25, 0.28);
  border-color: rgba(244, 201, 93, 0.18);
}

.home-action-card .label {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  color: #fff0c8;
}

.home-action-card h2,
.home-action-card strong {
  color: #fffdf8 !important;
}

.home-action-card p,
.home-action-card li {
  color: rgba(255, 248, 238, 0.84) !important;
}

.home-action-card a {
  background: linear-gradient(135deg, #fff2dc, #f4c95d);
  color: var(--ink) !important;
  box-shadow: none;
}

.home-action-card h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem) !important;
}

.home-action-card p,
.home-action-card li {
  color: var(--ink-soft);
}

.home-action-card ul {
  margin: 0;
  padding-left: 18px;
}

.home-action-card a {
  margin-top: 4px;
  width: fit-content;
}

.editor-page {
  gap: 24px;
}

.editor-shell {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

.editor-panel,
.editor-preview-panel,
.editor-help {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 245, 236, 0.98));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.08);
}

.editor-panel h2,
.editor-preview-panel h2,
.editor-help h2 {
  margin-bottom: 8px;
}

.editor-intro {
  margin-bottom: 14px;
}

.editor-workbench {
  display: grid;
  gap: 14px;
}

.editor-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 18px;
  background: rgba(20, 33, 61, 0.06);
}

.editor-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-soft) !important;
  font-weight: 800;
  box-shadow: none;
}

.editor-tab:hover {
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink) !important;
  transform: none;
}

.editor-tab.is-active {
  border-color: rgba(37, 75, 115, 0.16);
  background: #ffffff;
  color: var(--ink) !important;
}

.editor-tab-panels {
  min-height: 540px;
}

.editor-field {
  display: grid;
  gap: 8px;
}

.editor-field label {
  color: var(--ink);
  font-weight: 700;
}

.editor-field textarea {
  width: 100%;
  min-height: 540px;
  padding: 14px 16px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 18px;
  background: #101c30;
  color: #f7f2e8;
  resize: vertical;
  line-height: 1.55;
}

.editor-tab-panel[hidden] {
  display: none;
}

.editor-field textarea:focus,
.editor-toolbar button:focus,
.editor-tab:focus-visible {
  outline: 2px solid rgba(194, 84, 45, 0.28);
  outline-offset: 2px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.editor-toolbar button {
  min-width: 132px;
}

.editor-toolbar .secondary-action {
  background: linear-gradient(135deg, #1e3a5f, #284d78);
}

.editor-status {
  min-height: 24px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.editor-preview-frame {
  width: 100%;
  min-height: 620px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 20px;
  background: #ffffff;
}

.editor-help-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.editor-tip {
  padding: 18px;
  border-radius: 18px;
  background: rgba(20, 33, 61, 0.05);
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.editor-tip p:last-child,
.editor-preview-panel p:last-child,
.editor-panel p:last-child {
  margin-bottom: 0;
}

.assistant-page {
  gap: 24px;
  overflow: visible;
}

.assistant-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  align-items: start;
  min-height: 0;
}

.assistant-intro-card,
.assistant-chat-shell {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 245, 236, 0.98));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.08);
}

.assistant-sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 18px;
}

.assistant-sidebar-block {
  display: grid;
  gap: 12px;
}

.assistant-sidebar-block h3,
.assistant-chat-topbar h2 {
  margin: 0;
}

.assistant-sidebar-note {
  padding: 18px;
  border-radius: 18px;
  background: rgba(20, 33, 61, 0.05);
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.assistant-prompt-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.assistant-connection-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(20, 33, 61, 0.04);
}

.assistant-connection-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.assistant-connection-card p {
  margin: 0;
}

.assistant-connection-dot {
  width: 14px;
  height: 14px;
  margin-top: 6px;
  border-radius: 999px;
  background: #b4382e;
  box-shadow: 0 0 0 6px rgba(180, 56, 46, 0.12);
}

.assistant-connection-card[data-state="checking"] .assistant-connection-dot {
  background: #d28d1b;
  box-shadow: 0 0 0 6px rgba(210, 141, 27, 0.12);
}

.assistant-connection-card[data-state="online"] .assistant-connection-dot {
  background: #1d7a4c;
  box-shadow: 0 0 0 6px rgba(29, 122, 76, 0.12);
}

.assistant-connection-card[data-state="offline"] .assistant-connection-dot {
  background: #b4382e;
  box-shadow: 0 0 0 6px rgba(180, 56, 46, 0.12);
}

.assistant-prompt-chip {
  min-height: auto;
  padding: 10px 14px;
  background: rgba(20, 33, 61, 0.06);
  border: 1px solid rgba(20, 33, 61, 0.1);
  color: var(--ink) !important;
  box-shadow: none;
}

.assistant-prompt-chip:hover {
  background: rgba(20, 33, 61, 0.1);
}

.assistant-chat-shell,
.assistant-form {
  display: grid;
  gap: 16px;
}

.assistant-chat-shell {
  position: relative;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: clamp(620px, calc(100vh - 180px), 760px);
  min-height: clamp(620px, calc(100dvh - 180px), 760px);
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(194, 84, 45, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(247, 240, 229, 0.98));
}

.assistant-chat-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(18, 44, 68, 0.08), transparent 22%);
  pointer-events: none;
}

.assistant-chat-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
}

.assistant-chat-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.assistant-chat-profile-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(194, 84, 45, 0.96), rgba(217, 140, 57, 0.92));
  color: #fff9f0;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 28px rgba(194, 84, 45, 0.18);
}

.assistant-chat-profile-copy p {
  margin-bottom: 0;
}

.assistant-chat-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(194, 84, 45, 0.1);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.assistant-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.assistant-messages {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  min-height: 360px;
  max-height: min(620px, calc(100vh - 280px));
  max-height: min(620px, calc(100dvh - 280px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 18px 12px 18px 4px;
  border-radius: 26px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(252, 247, 239, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.assistant-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.assistant-message-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.assistant-message-card {
  min-width: 0;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  box-shadow: 0 10px 24px rgba(20, 33, 61, 0.06);
}

.assistant-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.assistant-message-role {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.assistant-message-time {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.assistant-message-ai {
  justify-self: start;
}

.assistant-message-ai .assistant-message-avatar {
  background: rgba(194, 84, 45, 0.12);
  color: var(--brand-deep);
}

.assistant-message-ai .assistant-message-card {
  background: rgba(20, 33, 61, 0.05);
}

.assistant-message-ai .assistant-message-role {
  background: rgba(194, 84, 45, 0.1);
  color: var(--brand-deep);
}

.assistant-message-user {
  justify-self: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.assistant-message-user .assistant-message-avatar {
  order: 2;
  background: linear-gradient(135deg, rgba(18, 44, 68, 0.96), rgba(36, 70, 102, 0.94));
  color: #fff8ef;
}

.assistant-message-user .assistant-message-card {
  background: linear-gradient(135deg, rgba(18, 44, 68, 0.96), rgba(36, 70, 102, 0.94));
  color: #fff8ef;
}

.assistant-message-user p,
.assistant-message-user .assistant-message-time {
  color: rgba(255, 248, 238, 0.86);
}

.assistant-message-user .assistant-message-role {
  background: rgba(255, 255, 255, 0.14);
  color: #fff7dd;
}

.assistant-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 15px 16px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 18px;
  background: #101c30;
  color: #f7f2e8;
  resize: vertical;
  line-height: 1.55;
}

.assistant-form {
  position: relative;
  z-index: 1;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(255, 252, 246, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.assistant-form label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.assistant-form textarea:focus {
  outline: 2px solid rgba(194, 84, 45, 0.26);
  outline-offset: 2px;
}

.assistant-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(20, 33, 61, 0.08);
}

.assistant-status {
  margin: 0;
  color: var(--ink-soft);
}

.mft-ai-widget {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 1700;
  overflow: visible;
}

.mft-ai-launcher {
  position: fixed;
  z-index: 1700;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  min-width: 172px;
  padding: 10px 16px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(18, 44, 68, 0.98), rgba(36, 70, 102, 0.96) 55%, rgba(194, 84, 45, 0.94));
  box-shadow: 0 24px 46px rgba(20, 33, 61, 0.26);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.mft-ai-launcher.is-dragging {
  cursor: grabbing;
  box-shadow: 0 28px 52px rgba(20, 33, 61, 0.32);
}

.mft-ai-launcher-ring {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.16);
}

.mft-ai-launcher-avatar,
.mft-ai-panel-avatar,
.mft-ai-message-avatar {
  display: grid;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.mft-ai-launcher-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff8ef;
  font-size: 0.78rem;
}

.mft-ai-launcher-copy {
  display: grid;
  gap: 2px;
  text-align: left;
  color: #fff8ef;
}

.mft-ai-launcher-copy strong {
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.05;
}

.mft-ai-launcher-copy span {
  color: rgba(255, 248, 239, 0.78);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.mft-ai-launcher-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #d28d1b;
  box-shadow: 0 0 0 5px rgba(210, 141, 27, 0.16);
  font-size: 0;
}

.mft-ai-widget[data-connection="online"] .mft-ai-launcher-dot {
  background: #1d7a4c;
  box-shadow: 0 0 0 5px rgba(29, 122, 76, 0.16);
}

.mft-ai-widget[data-connection="offline"] .mft-ai-launcher-dot {
  background: #b4382e;
  box-shadow: 0 0 0 5px rgba(180, 56, 46, 0.16);
}

.mft-ai-panel {
  position: fixed;
  z-index: 1701;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px 0 0 28px;
  background:
    radial-gradient(circle at top left, rgba(244, 201, 93, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(245, 237, 225, 0.98));
  box-shadow: 0 28px 54px rgba(20, 33, 61, 0.24);
  backdrop-filter: blur(14px);
  overscroll-behavior: contain;
}

.mft-ai-panel[hidden] {
  display: none;
}

.mft-ai-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
}

.mft-ai-panel-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mft-ai-panel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(194, 84, 45, 0.96), rgba(217, 140, 57, 0.92));
  color: #fff8ef;
  box-shadow: 0 14px 24px rgba(194, 84, 45, 0.18);
}

.mft-ai-panel-header strong {
  display: block;
  margin-bottom: 2px;
}

.mft-ai-panel-header p {
  margin: 0;
}

.mft-ai-panel-actions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mft-ai-panel-actions button {
  position: relative;
  z-index: 3;
  min-height: 38px;
  padding: 10px 14px;
  pointer-events: auto;
  touch-action: manipulation;
  box-shadow: none;
}

.mft-ai-messages {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 6px 4px 6px 0;
}

.mft-ai-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.mft-ai-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  font-size: 0.72rem;
}

.mft-ai-message-bubble {
  padding: 14px 15px;
  border-radius: 20px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  box-shadow: 0 10px 22px rgba(20, 33, 61, 0.06);
}

.mft-ai-message-bubble p {
  margin: 0;
}

.mft-ai-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mft-ai-message-meta time {
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
}

.mft-ai-message-assistant .mft-ai-message-avatar {
  background: rgba(194, 84, 45, 0.12);
  color: var(--brand-deep);
}

.mft-ai-message-assistant .mft-ai-message-bubble {
  background: rgba(20, 33, 61, 0.05);
}

.mft-ai-message-user {
  justify-self: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.mft-ai-message-user .mft-ai-message-avatar {
  order: 2;
  background: linear-gradient(135deg, rgba(18, 44, 68, 0.96), rgba(36, 70, 102, 0.94));
  color: #fff8ef;
}

.mft-ai-message-user .mft-ai-message-bubble {
  background: linear-gradient(135deg, rgba(18, 44, 68, 0.96), rgba(36, 70, 102, 0.94));
  color: #fff8ef;
}

.mft-ai-message-user .mft-ai-message-meta,
.mft-ai-message-user .mft-ai-message-meta time,
.mft-ai-message-user .mft-ai-message-bubble p {
  color: rgba(255, 248, 239, 0.88);
}

.mft-ai-form {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 33, 61, 0.08);
  align-self: end;
}

.mft-ai-hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mft-ai-form textarea {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 18px;
  background: #101c30;
  color: #f7f2e8;
  resize: none;
  line-height: 1.5;
}

.mft-ai-form textarea:focus {
  outline: 2px solid rgba(194, 84, 45, 0.26);
  outline-offset: 2px;
}

.mft-ai-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mft-ai-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.mft-ai-send {
  min-width: 88px;
}

html.html-ai-embedded,
html.html-ai-embedded body {
  height: 100%;
}

html.html-ai-embedded body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

html.html-ai-embedded body::before,
html.html-ai-embedded body > header,
html.html-ai-embedded .assistant-sidebar,
html.html-ai-embedded .site-footer,
html.html-ai-embedded .site-top-banner,
html.html-ai-embedded .site-floating-auth,
html.html-ai-embedded .site-floating-profile {
  display: none !important;
}

html.html-ai-embedded body > main {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: none;
  background: transparent;
}

html.html-ai-embedded body > main::before {
  display: none;
}

html.html-ai-embedded .assistant-layout {
  height: 100%;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
}

html.html-ai-embedded .assistant-chat-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
}

html.html-ai-embedded .assistant-messages {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0;
}

html.html-ai-embedded .assistant-form {
  border-radius: 0;
}

html.html-ai-embedded .auth-gate-card {
  width: min(100% - 28px, 520px);
  margin: 14px auto;
}

body.mft-ai-panel-open {
  overflow: hidden;
}

.mft-ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1699;
  border: 0;
  padding: 0;
  background: rgba(7, 14, 26, 0.58);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.mft-ai-backdrop[hidden] {
  display: none;
}

.mft-ai-launcher {
  right: 24px;
  bottom: 24px;
  cursor: pointer;
  touch-action: manipulation;
}

.mft-ai-widget[data-open="true"] .mft-ai-launcher {
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.32);
  transform: translateY(2px);
}

.mft-ai-panel {
  top: 0;
  right: 0;
  left: auto !important;
  width: min(500px, calc(100vw - 18px)) !important;
  max-width: 100vw;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.mft-ai-panel-header p {
  color: var(--ink-soft);
}

.mft-ai-panel-actions button,
.mft-ai-panel-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}

.mft-ai-frame-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.mft-ai-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
}

.site-footer {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.site-footer p {
  margin-bottom: 0;
}

.auth-gate-card {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 242, 232, 0.98));
  box-shadow: var(--shadow);
}

/* HTML AI rebuild */
main.html-ai-page {
  display: grid;
  gap: 24px;
}

.html-ai-overview {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  background:
    radial-gradient(circle at top right, rgba(84, 164, 199, 0.15), transparent 26%),
    radial-gradient(circle at bottom left, rgba(239, 107, 61, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(247, 240, 229, 0.99));
}

.html-ai-overview-copy {
  display: grid;
  gap: 12px;
}

.html-ai-overview-copy p {
  margin-bottom: 0;
}

.html-ai-stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.html-ai-stat-card {
  display: grid;
  gap: 0;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(20, 33, 61, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.html-ai-stat-card span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.html-ai-stat-card strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--ink);
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
  line-height: 1.15;
}

.html-ai-stat-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.html-ai-sidebar {
  position: sticky;
  top: 24px;
}

.assistant-prompt-list {
  display: grid;
  gap: 10px;
}

.assistant-prompt-chip {
  justify-content: flex-start;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  text-align: left;
  background: rgba(20, 33, 61, 0.06);
  border: 1px solid rgba(20, 33, 61, 0.1);
  color: var(--ink) !important;
  box-shadow: none;
}

.assistant-prompt-chip:hover {
  background: rgba(20, 33, 61, 0.1);
  transform: translateY(-2px);
}

.assistant-connection-card {
  align-items: center;
  gap: 12px;
}

.assistant-connection-card[data-state="checking"] .assistant-connection-dot {
  background: #d28d1b;
  box-shadow: 0 0 0 6px rgba(210, 141, 27, 0.12);
}

.assistant-connection-card[data-state="online"] .assistant-connection-dot {
  background: #1d7a4c;
  box-shadow: 0 0 0 6px rgba(29, 122, 76, 0.12);
}

.assistant-connection-card[data-state="demo"] .assistant-connection-dot {
  background: #2563eb;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.assistant-connection-card[data-state="offline"] .assistant-connection-dot {
  background: #b4382e;
  box-shadow: 0 0 0 6px rgba(180, 56, 46, 0.12);
}

.assistant-chat-shell {
  gap: 18px;
  min-height: clamp(660px, calc(100vh - 180px), 820px);
  min-height: clamp(660px, calc(100dvh - 180px), 820px);
  background:
    radial-gradient(circle at top left, rgba(194, 84, 45, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(247, 240, 229, 0.98));
}

.assistant-chat-topbar {
  align-items: center;
}

.assistant-chat-profile-copy {
  max-width: 42ch;
}

.assistant-chat-profile-copy p {
  margin-bottom: 0;
}

.assistant-messages {
  padding: 18px 14px 18px 6px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(252, 247, 239, 0.9));
}

.assistant-message-card > p:last-child,
.assistant-message-card > pre:last-child,
.assistant-message-card > ul:last-child,
.assistant-message-card > ol:last-child {
  margin-bottom: 0;
}

.assistant-message-system {
  grid-template-columns: auto minmax(0, 1fr);
}

.assistant-message-system .assistant-message-avatar {
  background: rgba(20, 33, 61, 0.08);
  color: var(--ink-soft);
}

.assistant-message-system .assistant-message-card {
  background: rgba(20, 33, 61, 0.04);
  border-style: dashed;
}

.assistant-message-system .assistant-message-role {
  background: rgba(20, 33, 61, 0.08);
  color: var(--ink);
}

.assistant-form {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 252, 246, 0.94);
}

.assistant-form textarea {
  min-height: 126px;
  background: #101c30;
  color: #f7f2e8;
}

.assistant-form textarea:disabled,
.assistant-form button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.assistant-status {
  min-height: 22px;
}

.assistant-input-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assistant-count {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.assistant-secondary-button,
.assistant-code-bar button {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: none;
}

.assistant-message-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.assistant-message-body ul {
  margin: 0;
  padding-left: 20px;
}

.assistant-code-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 14px;
  background: #0e1728;
}

.assistant-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 248, 238, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.assistant-code-bar button {
  min-height: 30px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff8ef;
}

.assistant-code-block pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #f7f2e8;
  background: transparent;
  white-space: pre;
}

.assistant-code-block code {
  color: inherit;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

.html-ai-page .hero-actions {
  margin-top: 4px;
}

html.html-ai-embedded .html-ai-overview {
  display: none !important;
}

html.html-ai-widget-mode body > main,
html.html-ai-widget-mode main.html-ai-page {
  min-height: 100% !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: 1fr !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

html.html-ai-widget-mode .html-ai-overview,
html.html-ai-widget-mode .assistant-sidebar,
html.html-ai-widget-mode .top-name-bar,
html.html-ai-widget-mode .site-footer {
  display: none !important;
}

html.html-ai-widget-mode .assistant-layout {
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
  height: 100% !important;
  gap: 0 !important;
}

html.html-ai-widget-mode .assistant-chat-shell {
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

html.html-ai-widget-mode .assistant-chat-topbar {
  padding-bottom: 12px !important;
}

html.html-ai-widget-mode .assistant-messages {
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border-radius: 0 !important;
}

html.html-ai-widget-mode .assistant-form {
  border-radius: 0 !important;
}

html.html-ai-widget-mode .assistant-form textarea {
  min-height: 92px;
}

body.ai-chatbot-page {
  background:
    linear-gradient(180deg, rgba(249, 251, 255, 0.96), rgba(239, 244, 248, 0.96));
}

body.ai-chatbot-page::before {
  display: none;
}

body.ai-chatbot-page > header {
  margin-bottom: 12px;
}

body.ai-chatbot-page > header h1 {
  font-size: clamp(1.85rem, 4vw, 3.1rem);
}

body.ai-chatbot-page > header #p {
  max-width: 760px;
}

body.ai-chatbot-page main.html-ai-page {
  width: min(980px, calc(100% - 24px));
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.ai-chatbot-page main.html-ai-page::before,
body.ai-chatbot-page .html-ai-overview {
  display: none;
}

body.ai-chatbot-page .assistant-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

body.ai-chatbot-page .assistant-sidebar {
  position: static;
  order: 2;
}

body.ai-chatbot-page .assistant-sidebar-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(20, 33, 61, 0.08);
}

body.ai-chatbot-page .assistant-sidebar-block h3 {
  display: none;
}

body.ai-chatbot-page .assistant-prompt-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

body.ai-chatbot-page .assistant-prompt-chip {
  flex: 0 0 auto;
  width: auto;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink) !important;
  font-size: 0.9rem;
  white-space: nowrap;
}

body.ai-chatbot-page .assistant-connection-card {
  grid-template-columns: auto 1fr;
  min-width: 210px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

body.ai-chatbot-page .assistant-connection-card p {
  display: none;
}

body.ai-chatbot-page .assistant-connection-card strong {
  margin: 0;
  font-size: 0.9rem;
}

body.ai-chatbot-page .assistant-chat-shell {
  order: 1;
  min-height: min(760px, calc(100dvh - 190px));
  max-height: min(760px, calc(100dvh - 190px));
  padding: 0;
  gap: 0;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 52px rgba(20, 33, 61, 0.12);
  overflow: hidden;
}

body.ai-chatbot-page .assistant-chat-shell::before {
  display: none;
}

body.ai-chatbot-page .assistant-chat-topbar {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

body.ai-chatbot-page .assistant-chat-profile {
  gap: 10px;
}

body.ai-chatbot-page .assistant-chat-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #172033;
  box-shadow: none;
  font-size: 0.74rem;
}

body.ai-chatbot-page .assistant-chat-eyebrow,
body.ai-chatbot-page .assistant-message-meta {
  display: none;
}

body.ai-chatbot-page .assistant-chat-profile-copy h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.05rem;
  line-height: 1.2;
}

body.ai-chatbot-page .assistant-chat-profile-copy p {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

body.ai-chatbot-page .assistant-topbar-actions {
  gap: 8px;
}

body.ai-chatbot-page .assistant-secondary-button {
  min-height: 34px;
  padding: 8px 11px;
  border-radius: 999px;
  border-color: rgba(20, 33, 61, 0.45);
  background: #14213d;
  color: #fffaf2;
}

body.ai-chatbot-page .assistant-secondary-button:hover,
body.ai-chatbot-page .assistant-secondary-button:focus-visible {
  background: #0c162c;
  border-color: #0c162c;
  color: #ffffff;
}

body.ai-chatbot-page .assistant-messages {
  min-height: 0;
  max-height: none;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: #f7f9fc;
  box-shadow: none;
}

body.ai-chatbot-page .assistant-message {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: none;
}

body.ai-chatbot-page .assistant-message-avatar {
  display: none;
}

body.ai-chatbot-page .assistant-message-ai,
body.ai-chatbot-page .assistant-message-assistant {
  justify-self: stretch;
}

body.ai-chatbot-page .assistant-message-user {
  justify-self: stretch;
}

body.ai-chatbot-page .assistant-message-card {
  padding: 8px 0 14px;
  border: 0;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

body.ai-chatbot-page .assistant-message-user .assistant-message-card {
  border-color: rgba(20, 33, 61, 0.08);
  background: transparent;
  color: var(--ink);
}

body.ai-chatbot-page .assistant-message-user p,
body.ai-chatbot-page .assistant-message-user li {
  color: var(--ink);
  font-weight: 650;
}

body.ai-chatbot-page .assistant-message-user .assistant-message-body::before,
body.ai-chatbot-page .assistant-message-ai .assistant-message-body::before,
body.ai-chatbot-page .assistant-message-assistant .assistant-message-body::before {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.ai-chatbot-page .assistant-message-user .assistant-message-body::before {
  content: "You";
}

body.ai-chatbot-page .assistant-message-ai .assistant-message-body::before,
body.ai-chatbot-page .assistant-message-assistant .assistant-message-body::before {
  content: "Assistant";
}

body.ai-chatbot-page .assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 0;
  border-top: 1px solid rgba(20, 33, 61, 0.08);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

body.ai-chatbot-page .assistant-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

body.ai-chatbot-page .assistant-form textarea {
  min-height: 48px;
  max-height: 132px;
  padding: 13px 15px;
  border-radius: 18px;
  background: #f3f6fa;
  color: var(--ink);
  resize: vertical;
}

body.ai-chatbot-page .assistant-form-actions {
  display: grid;
  grid-template-columns: auto;
  gap: 6px;
  padding: 0;
  border: 0;
}

body.ai-chatbot-page .assistant-status {
  justify-self: end;
  min-height: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

body.ai-chatbot-page .assistant-input-actions {
  gap: 8px;
}

body.ai-chatbot-page .assistant-count {
  display: none;
}

body.ai-chatbot-page .assistant-form button[type="submit"] {
  min-width: 58px;
  min-height: 42px;
  border-radius: 999px;
}

html.html-ai-widget-mode body.ai-chatbot-page main.html-ai-page {
  width: 100%;
}

html.html-ai-widget-mode body.ai-chatbot-page .assistant-chat-shell {
  min-height: 100% !important;
  max-height: none !important;
  border: 0;
  border-radius: 0 !important;
  box-shadow: none;
}

html.html-ai-widget-mode body.ai-chatbot-page .assistant-messages {
  background: #f7f9fc;
}

.mft-ai-widget {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 1700;
  overflow: visible;
}

body.mft-ai-panel-open {
  overflow: hidden;
}

.mft-ai-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1700;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 216px;
  padding: 12px 14px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(18, 44, 68, 0.98), rgba(36, 70, 102, 0.96) 55%, rgba(194, 84, 45, 0.94));
  box-shadow: 0 24px 46px rgba(20, 33, 61, 0.26);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.mft-ai-launcher:hover {
  transform: translateY(-2px);
}

.mft-ai-launcher-avatar,
.mft-ai-panel-avatar {
  display: grid;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.mft-ai-launcher-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff8ef;
  font-size: 0.78rem;
}

.mft-ai-launcher-copy {
  display: grid;
  gap: 2px;
  text-align: left;
  color: #fff8ef;
}

.mft-ai-launcher-copy strong {
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.05;
}

.mft-ai-launcher-copy span {
  color: rgba(255, 248, 239, 0.78);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.mft-ai-launcher-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  color: rgba(255, 248, 239, 0.82);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mft-ai-launcher-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #d28d1b;
  box-shadow: 0 0 0 5px rgba(210, 141, 27, 0.16);
}

.mft-ai-widget[data-connection="online"] .mft-ai-launcher-dot {
  background: #1d7a4c;
  box-shadow: 0 0 0 5px rgba(29, 122, 76, 0.16);
}

.mft-ai-widget[data-connection="demo"] .mft-ai-launcher-dot {
  background: #2563eb;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.16);
}

.mft-ai-widget[data-connection="offline"] .mft-ai-launcher-dot {
  background: #b4382e;
  box-shadow: 0 0 0 5px rgba(180, 56, 46, 0.16);
}

.mft-ai-panel {
  position: fixed;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  z-index: 1701;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  width: min(520px, 100vw) !important;
  max-width: 100vw !important;
  height: auto !important;
  max-height: 100vh !important;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 0 !important;
  background:
    radial-gradient(circle at top left, rgba(244, 201, 93, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(245, 237, 225, 0.98));
  box-shadow: 0 30px 60px rgba(20, 33, 61, 0.24);
  backdrop-filter: blur(18px);
  overscroll-behavior: contain;
}

.mft-ai-panel[hidden] {
  display: none;
}

.mft-ai-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
}

.mft-ai-panel-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mft-ai-panel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(194, 84, 45, 0.96), rgba(217, 140, 57, 0.92));
  color: #fff8ef;
  box-shadow: 0 14px 24px rgba(194, 84, 45, 0.18);
}

.mft-ai-panel-header strong {
  display: block;
  margin-bottom: 2px;
}

.mft-ai-panel-header p {
  margin: 0;
  color: var(--ink-soft);
}

.mft-ai-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mft-ai-panel-actions a,
.mft-ai-panel-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 14px;
  text-decoration: none !important;
  box-shadow: none;
}

.mft-ai-frame-shell {
  min-height: 0;
  overflow: hidden;
  border-radius: 0;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.mft-ai-frame {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
}

.mft-ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1699;
  border: 0;
  padding: 0;
  background: rgba(7, 14, 26, 0.58);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.mft-ai-backdrop[hidden] {
  display: none;
}

@media (max-width: 960px) {
  .html-ai-overview {
    grid-template-columns: 1fr;
  }

  .html-ai-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .assistant-layout {
    grid-template-columns: 1fr;
  }

  .assistant-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .html-ai-stat-grid {
    grid-template-columns: 1fr;
  }

  .assistant-chat-profile,
  .assistant-topbar-actions,
  .assistant-form-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .mft-ai-launcher {
    right: 14px;
    bottom: 14px;
    min-width: 168px;
    padding: 11px 13px 11px 11px;
  }

  .mft-ai-launcher-copy span {
    display: none;
  }

  .mft-ai-panel {
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    padding: 16px;
    border-radius: 0;
  }

  .mft-ai-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .mft-ai-panel-actions {
    justify-content: flex-start;
  }
}

.auth-gate-card h2 {
  margin-bottom: 0;
}

.auth-gate-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.auth-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-gate-actions a.secondary {
  background: rgba(20, 33, 61, 0.06);
  border-color: rgba(20, 33, 61, 0.14);
  color: var(--ink) !important;
  box-shadow: none;
}

.auth-gate-actions a.secondary:hover {
  background: rgba(20, 33, 61, 0.1);
}

.footer-note {
  margin: 0;
  max-width: 72ch;
  text-align: center;
  color: var(--ink);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.98rem;
  line-height: 1.6;
}

.footer-note a {
  display: inline-flex;
  margin-top: 8px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 0;
  color: rgba(255, 248, 238, 0.78);
  font-size: 0.92rem;
}

.site-footer-links a {
  color: #fff5d6;
  font-weight: 700;
}

.mft-adsense-wrap {
  width: var(--content-width);
  min-height: 90px;
  margin: 24px auto;
  overflow: hidden;
}

.mft-adsense-top {
  margin-top: 18px;
}

.mft-adsense-content {
  margin-top: 28px;
  margin-bottom: 28px;
}

.auth-page {
  display: block;
  padding-bottom: 56px;
}

.auth-page .site-floating-auth {
  display: none;
}

.auth-shell {
  width: var(--content-width);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.auth-intro,
.auth-panel {
  padding: clamp(22px, 3vw, 30px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-intro {
  background:
    linear-gradient(145deg, rgba(18, 44, 68, 0.98), rgba(30, 66, 97, 0.95) 55%, rgba(194, 84, 45, 0.9));
  color: #fff8ef;
}

.auth-intro h1 {
  margin: 14px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.98;
}

.auth-intro p,
.auth-intro li {
  color: rgba(255, 248, 238, 0.84);
}

.auth-panel {
  background: rgba(255, 250, 243, 0.95);
}

.auth-grid {
  display: grid;
  gap: 18px;
}

.auth-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid rgba(20, 33, 61, 0.1);
}

.auth-card h2 {
  margin-bottom: 8px;
}

.auth-card p {
  margin-bottom: 14px;
}

.auth-card label {
  display: block;
  margin: 12px 0 6px;
  color: var(--ink);
  font-weight: 700;
}

.auth-card input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--ink);
}

.auth-card input:focus {
  outline: 2px solid rgba(194, 84, 45, 0.24);
  outline-offset: 2px;
  border-color: rgba(194, 84, 45, 0.4);
}

.auth-card button {
  width: 100%;
  margin-top: 16px;
}

.status {
  min-height: 22px;
  margin-top: 12px;
  font-size: 0.94rem;
}

.status.ok {
  color: #1d7a4c;
}

.status.err {
  color: #b4382e;
}

.auth-benefits {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.auth-benefit {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-benefit strong {
  display: block;
  margin-bottom: 4px;
  color: #fff5d6;
}

.quiet-note {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.hidden {
  display: none !important;
}

.profile-page {
  gap: 26px;
}

.profile-hero,
.profile-card,
.profile-list-card,
.profile-activity-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 240, 229, 0.98));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.08);
}

.profile-hero::before,
.profile-card::before,
.profile-list-card::before,
.profile-activity-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #f4c95d, var(--accent));
}

.profile-hero,
.profile-card,
.profile-list-card,
.profile-activity-card {
  padding: 24px;
}

.profile-hero {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  background:
    radial-gradient(circle at top right, rgba(244, 201, 93, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 240, 229, 0.99));
}

.profile-identity {
  display: flex;
  gap: 16px;
  align-items: center;
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--brand), #f4c95d);
  color: var(--ink);
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 18px 32px rgba(194, 84, 45, 0.2);
}

.profile-identity-copy h2 {
  margin-bottom: 8px;
}

.profile-identity-copy p {
  margin: 0;
}

.profile-streak-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.profile-streak-ring {
  display: grid;
  place-items: center;
  width: 148px;
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.94) 0 43%, transparent 44%),
    conic-gradient(var(--brand), #f4c95d, var(--accent), var(--brand));
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.74), 0 18px 34px rgba(20, 33, 61, 0.1);
}

.profile-streak-ring strong {
  font-size: 2rem;
  line-height: 1;
}

.profile-streak-ring span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-stats-grid,
.profile-section-grid {
  display: grid;
  gap: 18px;
}

.profile-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.profile-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 1.7rem;
}

.profile-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.profile-report-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 242, 232, 0.98));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.08);
}

.profile-report-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #1e3a5f, #f4c95d, var(--brand));
}

.profile-report-head,
.profile-list-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-report-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}

.profile-report-stat-grid div {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(20, 33, 61, 0.05);
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.profile-report-stat-grid span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-report-stat-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.profile-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.08);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-status-pill.is-pass {
  background: rgba(39, 126, 79, 0.14);
  color: #1f6f45;
}

.profile-status-pill.is-fail {
  background: rgba(194, 84, 45, 0.16);
  color: #963f23;
}

.profile-status-pill.is-info {
  background: rgba(30, 58, 95, 0.12);
  color: #1e3a5f;
}

.profile-score-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-section-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.profile-list,
.profile-activity-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.profile-list-item,
.profile-activity-item {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.profile-list-item strong,
.profile-activity-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.profile-meta {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.profile-empty {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(20, 33, 61, 0.04);
  border: 1px dashed rgba(20, 33, 61, 0.14);
  color: var(--ink-soft);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.profile-signout {
  background: linear-gradient(135deg, #1e3a5f, #284d78) !important;
}

.exam-page {
  gap: 24px;
}

.exam-hero,
.exam-start-card,
.exam-sidebar-card,
.exam-problem-summary,
.exam-results,
.certificate-card,
.exam-lesson-group,
.exam-problem-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 242, 232, 0.98));
  box-shadow: 0 18px 38px rgba(20, 33, 61, 0.08);
}

.exam-hero,
.exam-start-card,
.exam-results,
.certificate-card,
.exam-problem-summary,
.exam-lesson-group {
  padding: 24px;
}

.exam-rule-grid,
.exam-result-grid,
.certificate-meta {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.exam-rule-card,
.exam-result-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(20, 33, 61, 0.05);
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.exam-rule-card strong,
.exam-result-card strong,
.certificate-meta strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.2rem;
}

.exam-start-form,
.exam-sidebar-actions,
.exam-problem-container,
.exam-content,
.exam-snippet-grid,
.exam-feedback {
  display: grid;
  gap: 16px;
}

.exam-start-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 16px;
  background: #fffdf8;
  color: var(--ink);
}

.secondary-action {
  background: linear-gradient(135deg, #1e3a5f, #284d78);
}

.exam-start-status {
  min-height: 24px;
  margin: 0;
  color: var(--ink-soft);
}

.exam-start-actions,
.exam-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.exam-sidebar {
  display: grid;
  gap: 22px;
}

.exam-shell {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  align-items: start;
}

.exam-workspace {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  align-items: start;
}

.exam-sticky {
  position: sticky;
  top: 24px;
  padding: 22px;
}

.exam-candidate {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
}

.exam-stat-list {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.exam-stat-list div {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(20, 33, 61, 0.05);
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.exam-stat-list span,
.exam-result-card span,
.certificate-meta span,
.exam-snippet-panel span,
.exam-answer-panel span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.exam-stat-list strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.5rem;
}

.exam-question-list-card,
.exam-editor-card,
.exam-preview-card {
  padding: 22px;
}

.exam-question-list {
  display: grid;
  gap: 10px;
  max-height: 820px;
  overflow: auto;
  padding-right: 4px;
}

.exam-question-button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  background: rgba(20, 33, 61, 0.04);
  color: var(--ink);
  text-align: left;
}

.exam-question-button:hover {
  border-color: rgba(194, 84, 45, 0.28);
  background: rgba(194, 84, 45, 0.08);
  transform: none;
}

.exam-question-button-number {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.1);
  font-weight: 800;
}

.exam-question-button-copy {
  font-size: 0.95rem;
  line-height: 1.45;
}

.exam-question-button.is-active {
  border-color: rgba(194, 84, 45, 0.42);
  background: rgba(194, 84, 45, 0.14);
}

.exam-question-button.is-answered {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.08);
}

.exam-question-button.is-correct {
  border-color: rgba(29, 122, 76, 0.32);
  background: rgba(29, 122, 76, 0.09);
}

.exam-question-button.is-incorrect {
  border-color: rgba(180, 56, 46, 0.3);
  background: rgba(180, 56, 46, 0.08);
}

.exam-lesson-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.exam-problem-grid {
  display: grid;
  gap: 18px;
}

.exam-problem-card {
  padding: 20px;
}

.exam-editor-card {
  display: grid;
  gap: 18px;
}

.exam-problem-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.exam-problem-number,
.exam-problem-lesson {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.08);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exam-current-prompt {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
}

.exam-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.exam-snippet-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.exam-snippet-panel,
.exam-answer-panel {
  display: grid;
  gap: 10px;
}

.exam-snippet-panel pre,
.exam-answer-panel textarea,
.exam-feedback pre {
  margin: 0;
  border-radius: 18px;
}

.exam-answer-panel textarea {
  width: 100%;
  min-height: 420px;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  background: #101c30;
  color: #f7f2e8;
  resize: vertical;
  line-height: 1.55;
}

.exam-preview-card {
  display: grid;
  gap: 16px;
}

.exam-preview-head p {
  margin: 0;
}

.exam-preview-frame {
  width: 100%;
  min-height: 640px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 18px;
  background: #ffffff;
}

.exam-answer-panel textarea:focus,
.exam-start-form input:focus {
  outline: 2px solid rgba(194, 84, 45, 0.26);
  outline-offset: 2px;
}

.exam-feedback {
  padding: 16px;
  border-radius: 18px;
  background: rgba(20, 33, 61, 0.05);
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.exam-problem-card.is-correct {
  border-color: rgba(29, 122, 76, 0.35);
}

.exam-problem-card.is-correct .exam-feedback {
  background: rgba(29, 122, 76, 0.08);
  border-color: rgba(29, 122, 76, 0.2);
}

.exam-problem-card.is-incorrect {
  border-color: rgba(180, 56, 46, 0.32);
}

.exam-problem-card.is-incorrect .exam-feedback {
  background: rgba(180, 56, 46, 0.08);
  border-color: rgba(180, 56, 46, 0.2);
}

.exam-results {
  display: grid;
  gap: 18px;
}

.certificate-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(18, 44, 68, 0.98), rgba(36, 70, 102, 0.95) 54%, rgba(194, 84, 45, 0.9));
  color: #fff8ef;
}

.certificate-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.certificate-ornaments {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.certificate-medal {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.18));
}

.certificate-ribbon {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  height: 78px;
}

.certificate-topline {
  color: #ffe6a8;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.certificate-card h3 {
  margin: 12px 0;
  color: #fffef8;
  font-size: clamp(2rem, 4vw, 3rem);
}

.certificate-copy {
  max-width: 60ch;
  color: rgba(255, 248, 238, 0.86);
}

.certificate-kicker {
  margin: 0 0 10px;
  color: rgba(255, 240, 212, 0.88);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.certificate-candidate-name {
  margin: 0 0 16px;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-align: left;
}

.certificate-copy strong,
.certificate-meta strong {
  color: #fffef8;
}

.certificate-meta {
  margin: 24px 0;
}

.certificate-meta div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.certificate-signoff {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 24px;
}

.certificate-signature-block {
  min-width: min(100%, 300px);
  padding-top: 10px;
  border-top: 2px solid rgba(255, 255, 255, 0.34);
  text-align: center;
}

.certificate-signature-name {
  margin: -8px 0 2px;
  color: #fff7dd;
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1;
}

.certificate-signature-label {
  margin: 0;
  color: rgba(255, 248, 238, 0.76);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.certificate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.certificate-actions > * {
  min-width: 180px;
}

.print-certificate .certificate-card {
  box-shadow: none;
}

.print-certificate .site-top-banner,
.print-certificate .site-floating-auth,
.print-certificate header,
.print-certificate .exam-hero,
.print-certificate .exam-start-card,
.print-certificate .exam-shell {
  display: none !important;
}

.print-certificate .exam-results {
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  body {
    padding-top: 20px;
  }

  header {
    padding: 22px;
  }

  header h1 {
    max-width: 100%;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .editor-shell {
    grid-template-columns: 1fr;
  }

  .lesson-course-layout {
    grid-template-columns: 1fr;
  }

  .lesson-course-sidebar {
    position: static;
    max-height: none;
  }

  .editor-tab-panels,
  .editor-field textarea {
    min-height: 420px;
  }

  .assistant-layout {
    grid-template-columns: 1fr;
  }

  .assistant-sidebar {
    position: static;
  }

  .mft-ai-panel {
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }

  .exam-shell {
    grid-template-columns: 1fr;
  }

  .exam-sticky {
    position: static;
  }

  .exam-workspace {
    grid-template-columns: 1fr;
  }

  .exam-question-list {
    max-height: 420px;
  }

  .exam-preview-frame {
    min-height: 360px;
  }

  .stat-grid,
  .lesson-grid,
  .roadmap-grid,
  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .home-spotlight {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  a.nav-link {
    width: 100%;
  }

  button,
  #open,
  #close,
  a.button-link,
  a#n,
  a#nav,
  a#yt,
  body > a:not(.site-floating-auth):not(.site-banner-link):not(.nav-link),
  article a:not(.nav-link),
  main a:not(.nav-link),
  footer a:not(.nav-link),
  .resource-link,
  a.nav-link {
    min-height: 52px;
    padding: 14px 18px;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: 48px;
  }

  nav {
    width: calc(100vw - 14px);
    padding: 22px 16px 20px;
    border-radius: 0 24px 24px 0;
  }

  body > header,
  body > main,
  body > article,
  body > footer,
  body > .lesson-course-layout,
  body > section {
    width: min(100% - 18px, 100%);
  }

  header,
  main,
  article,
  footer {
    padding: 18px;
    border-radius: 22px;
  }

  .home-spotlight,
  .home-section-intro,
  .home-action-card,
  .profile-hero,
  .profile-card,
  .profile-report-card,
  .profile-list-card,
  .profile-activity-card {
    padding: 20px;
  }

  .profile-report-stat-grid {
    grid-template-columns: 1fr;
  }

  .page-links,
  .hero-actions,
  .social-links,
  .auth-gate-actions,
  .assistant-form-actions,
  .assistant-prompt-list,
  .assistant-topbar-actions,
  .assistant-chat-profile,
  .mft-ai-form-row,
  .mft-ai-panel-actions {
    flex-direction: column;
  }

  .exam-start-actions,
  .exam-sidebar-actions,
  .exam-editor-actions,
  .certificate-actions {
    flex-direction: column;
  }

  .certificate-ornaments {
    justify-content: center;
  }

  .certificate-ribbon {
    display: none;
  }

  .certificate-signoff {
    justify-content: stretch;
  }

  .certificate-signature-block {
    width: 100%;
  }

  .page-links > *,
  .hero-actions > *,
  .social-links > *,
  .auth-gate-actions > *,
  .assistant-form-actions > *,
  .assistant-prompt-list > *,
  .assistant-topbar-actions > *,
  .mft-ai-panel-actions > *,
  .mft-ai-form-row > * {
    width: 100%;
  }

  .assistant-chat-profile {
    align-items: flex-start;
  }

  footer nav:not(#site-nav) {
    justify-content: stretch;
  }

  footer nav:not(#site-nav) a:last-child {
    margin-left: 0;
  }

  .assistant-chat-profile-avatar {
    width: 48px;
    height: 48px;
  }

  .assistant-messages {
    min-height: 320px;
    max-height: min(520px, calc(100vh - 260px));
    max-height: min(520px, calc(100dvh - 260px));
    padding: 14px 8px 14px 0;
  }

  .assistant-message-card {
    padding: 14px 15px;
  }

  .mft-ai-launcher {
    min-width: 154px;
    min-height: 58px;
    padding: 9px 14px 9px 10px;
  }

  .mft-ai-launcher-avatar,
  .mft-ai-panel-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .mft-ai-panel {
    padding: 16px;
    border-radius: 0;
  }

  .mft-ai-message-bubble {
    padding: 12px 13px;
  }

  .exam-start-actions > *,
  .exam-sidebar-actions > *,
  .exam-editor-actions > *,
  .certificate-actions > * {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.ai-chatbot-page main.html-ai-page {
    width: calc(100% - 14px);
  }

  body.ai-chatbot-page .assistant-chat-shell {
    min-height: calc(100dvh - 180px);
    max-height: calc(100dvh - 180px);
    border-radius: 16px;
  }

  body.ai-chatbot-page .assistant-sidebar-block {
    grid-template-columns: 1fr;
  }

  body.ai-chatbot-page .assistant-prompt-list {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  body.ai-chatbot-page .assistant-prompt-list > * {
    width: auto;
  }

  body.ai-chatbot-page .assistant-connection-card {
    justify-self: start;
    min-width: 0;
  }

  body.ai-chatbot-page .assistant-message {
    max-width: none;
  }

  body.ai-chatbot-page .assistant-chat-profile-copy p,
  body.ai-chatbot-page .assistant-topbar-actions {
    display: none;
  }

  body.ai-chatbot-page .assistant-form {
    grid-template-columns: 1fr;
  }

  body.ai-chatbot-page .assistant-form-actions {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  body.ai-chatbot-page .assistant-form-actions > * {
    width: auto;
  }

  body.ai-chatbot-page .assistant-status {
    justify-self: start;
  }
}

body.marketplace-shell {
  padding-bottom: 56px;
  background:
    linear-gradient(180deg, #eef4f7 0%, #f8faf7 42%, #edf2ee 100%);
  color: #172033;
  font-family: Arial, Helvetica, sans-serif;
}

body.marketplace-shell::before {
  display: none;
}

body.marketplace-shell > header,
body.marketplace-shell > main,
body.marketplace-shell > footer {
  width: min(1240px, calc(100% - 28px));
}

body.marketplace-shell header.marketplace-site-header {
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  background:
    linear-gradient(135deg, rgba(20, 32, 51, 0.98), rgba(31, 70, 92, 0.96) 58%, rgba(44, 99, 84, 0.94));
  box-shadow: 0 20px 56px rgba(20, 32, 51, 0.18);
}

body.marketplace-shell header.marketplace-site-header::before,
body.marketplace-shell header.marketplace-site-header::after {
  display: none;
}

body.marketplace-shell .marketplace-header-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: clamp(22px, 4vw, 46px);
  align-items: center;
}

body.marketplace-shell .marketplace-header-copy {
  display: grid;
  justify-items: start;
}

body.marketplace-shell header h1 {
  max-width: 12ch;
  margin-top: 18px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(2.5rem, 5.4vw, 5rem);
  letter-spacing: 0;
  line-height: 0.96;
}

body.marketplace-shell header #p {
  max-width: 680px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08) !important;
}

body.marketplace-shell .marketplace-showcase {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.marketplace-shell .marketplace-showcase-window {
  display: flex;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 12, 24, 0.22);
}

body.marketplace-shell .marketplace-showcase-window span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f3c85d;
}

body.marketplace-shell .marketplace-showcase-window span:nth-child(2) {
  background: #67b7dc;
}

body.marketplace-shell .marketplace-showcase-window span:nth-child(3) {
  background: #58c58a;
}

body.marketplace-shell .marketplace-showcase-body {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 30px);
}

body.marketplace-shell .marketplace-showcase-line {
  width: 64%;
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.42);
}

body.marketplace-shell .marketplace-showcase-line.is-wide {
  width: 86%;
  height: 20px;
  background: rgba(255, 255, 255, 0.74);
}

body.marketplace-shell .marketplace-showcase-cards,
body.marketplace-shell .marketplace-showcase-table {
  display: grid;
  gap: 10px;
}

body.marketplace-shell .marketplace-showcase-cards {
  grid-template-columns: repeat(3, 1fr);
}

body.marketplace-shell .marketplace-showcase-cards span,
body.marketplace-shell .marketplace-showcase-table span {
  min-height: 74px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.marketplace-shell .marketplace-showcase-table span {
  min-height: 34px;
}

body.marketplace-shell main.marketplace-page {
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  gap: 18px;
}

body.marketplace-shell main.marketplace-page::before {
  display: none;
}

body.marketplace-shell .marketplace-hero,
body.marketplace-shell .marketplace-category-panel,
body.marketplace-shell .marketplace-feed-card,
body.marketplace-shell .marketplace-detail-card,
body.marketplace-shell .marketplace-guide-card,
body.marketplace-shell .marketplace-create-card,
body.marketplace-shell .marketplace-deals-card,
body.marketplace-shell .marketplace-stat-card,
body.marketplace-shell .marketplace-deal-card {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(20, 32, 51, 0.08);
}

body.marketplace-shell .marketplace-hero::before,
body.marketplace-shell .marketplace-category-panel::before,
body.marketplace-shell .marketplace-feed-card::before,
body.marketplace-shell .marketplace-detail-card::before,
body.marketplace-shell .marketplace-guide-card::before,
body.marketplace-shell .marketplace-create-card::before,
body.marketplace-shell .marketplace-deals-card::before,
body.marketplace-shell .marketplace-stat-card::before,
body.marketplace-shell .marketplace-deal-card::before {
  display: none;
}

body.marketplace-shell .marketplace-hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  align-items: stretch;
  padding: clamp(22px, 3vw, 34px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 244, 0.96));
}

body.marketplace-shell .marketplace-section-heading {
  margin-bottom: 14px;
}

body.marketplace-shell .marketplace-section-heading h2,
body.marketplace-shell .marketplace-hero h2,
body.marketplace-shell .marketplace-guide-card h2 {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0;
}

body.marketplace-shell .label,
body.marketplace-shell .marketplace-mini-badge,
body.marketplace-shell .marketplace-chip,
body.marketplace-shell .marketplace-status-badge,
body.marketplace-shell #name {
  border-radius: 999px;
  letter-spacing: 0.08em;
}

body.marketplace-shell .marketplace-search-form {
  grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 0.8fr) minmax(140px, 0.7fr) auto;
  gap: 12px;
  margin-top: 22px;
}

body.marketplace-shell .marketplace-payment-note {
  max-width: 760px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(42, 111, 96, 0.18);
  background: #eaf6f0;
  color: #21493f;
  font-weight: 700;
}

body.marketplace-shell .marketplace-field span {
  margin-bottom: 0;
  color: #26364f;
  font-size: 0.86rem;
}

body.marketplace-shell .marketplace-field input,
body.marketplace-shell .marketplace-field select,
body.marketplace-shell .marketplace-field textarea {
  min-height: 46px;
  border-radius: 8px;
  border-color: rgba(20, 32, 51, 0.14);
  background: #ffffff;
  color: #172033;
  box-shadow: none;
}

body.marketplace-shell .marketplace-field textarea {
  line-height: 1.55;
}

body.marketplace-shell .marketplace-search-form button,
body.marketplace-shell .marketplace-card-actions button,
body.marketplace-shell .marketplace-card-actions a,
body.marketplace-shell .marketplace-deal-form button,
body.marketplace-shell .marketplace-create-card button,
body.marketplace-shell .marketplace-guide-card a {
  border-radius: 8px;
  background: #172033;
  box-shadow: none;
}

body.marketplace-shell .marketplace-stat-grid {
  grid-template-columns: 1fr;
}

body.marketplace-shell .marketplace-stat-card {
  padding: 18px;
  background: #172033;
  color: #f8fbff;
}

body.marketplace-shell .marketplace-stat-card .label {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #d7f3ff;
}

body.marketplace-shell .marketplace-stat-card strong {
  margin: 2px 0 4px;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

body.marketplace-shell .marketplace-stat-card p {
  margin: 0;
  color: rgba(248, 251, 255, 0.72);
}

body.marketplace-shell .marketplace-category-grid {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}

body.marketplace-shell .marketplace-category-card {
  min-height: 116px;
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: #f7faf8;
  color: #172033 !important;
  box-shadow: none;
}

body.marketplace-shell .marketplace-category-card strong,
body.marketplace-shell .marketplace-category-card span:last-child {
  color: #172033;
}

body.marketplace-shell .marketplace-category-card.is-active {
  border-color: rgba(42, 111, 96, 0.42);
  background: #e8f5ef;
}

body.marketplace-shell .marketplace-content-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
}

body.marketplace-shell .marketplace-listings-grid {
  gap: 12px;
}

body.marketplace-shell .marketplace-listing-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  border-color: rgba(20, 32, 51, 0.1);
  background: #ffffff;
  box-shadow: none;
}

body.marketplace-shell .marketplace-listing-card.is-selected {
  border-color: rgba(42, 111, 96, 0.5);
  box-shadow: inset 4px 0 0 rgba(42, 111, 96, 0.85);
}

body.marketplace-shell .marketplace-listing-card h3,
body.marketplace-shell .marketplace-deal-card h3,
body.marketplace-shell #marketplace-selected h3 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.16rem;
  letter-spacing: 0;
}

body.marketplace-shell .marketplace-listing-card p,
body.marketplace-shell #marketplace-selected p,
body.marketplace-shell .marketplace-deal-card p {
  margin-bottom: 0;
}

body.marketplace-shell .marketplace-detail-card {
  top: 96px;
}

body.marketplace-shell .marketplace-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 14px;
}

body.marketplace-shell .marketplace-detail-box,
body.marketplace-shell .marketplace-callout,
body.marketplace-shell .marketplace-deal-summary,
body.marketplace-shell .marketplace-empty,
body.marketplace-shell .marketplace-note-box {
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: #f7faf8;
}

body.marketplace-shell .marketplace-guide-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

body.marketplace-shell .marketplace-guide-list span {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: #ffffff;
  color: #26364f;
  font-weight: 700;
}

body.marketplace-shell .marketplace-builder-grid {
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
}

body.marketplace-shell .marketplace-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.marketplace-shell .marketplace-create-card button[type="submit"] {
  width: fit-content;
  min-width: 160px;
}

body.marketplace-shell .marketplace-deals-card {
  margin-bottom: 0;
}

body.marketplace-shell .marketplace-deals-grid {
  gap: 14px;
}

body.marketplace-shell .marketplace-timeline-item {
  border-radius: 8px;
}

body.marketplace-shell footer {
  border-radius: 8px;
}

@media (max-width: 900px) {
  body.marketplace-shell .marketplace-header-grid,
  body.marketplace-shell .marketplace-hero,
  body.marketplace-shell .marketplace-content-grid,
  body.marketplace-shell .marketplace-builder-grid {
    grid-template-columns: 1fr;
  }

  body.marketplace-shell .marketplace-search-form {
    grid-template-columns: 1fr 1fr;
  }

  body.marketplace-shell .marketplace-search-form button {
    grid-column: 1 / -1;
  }

  body.marketplace-shell .marketplace-detail-card {
    position: static;
  }
}

@media (max-width: 620px) {
  body.marketplace-shell > header,
  body.marketplace-shell > main,
  body.marketplace-shell > footer {
    width: calc(100% - 16px);
  }

  body.marketplace-shell .marketplace-search-form,
  body.marketplace-shell .marketplace-form-grid {
    grid-template-columns: 1fr;
  }

  body.marketplace-shell .marketplace-field.is-wide {
    grid-column: auto;
  }

  body.marketplace-shell .marketplace-showcase-cards {
    grid-template-columns: 1fr;
  }
}

body.community-shell {
  padding-bottom: 56px;
  background: linear-gradient(180deg, #f4f7fb 0%, #eef5f2 48%, #f8fafc 100%);
  color: #172033;
  font-family: Arial, Helvetica, sans-serif;
}

body.community-shell::before {
  display: none;
}

body.community-shell > header,
body.community-shell > main,
body.community-shell > footer {
  width: min(1240px, calc(100% - 28px));
}

body.community-shell header.community-site-header {
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  background:
    linear-gradient(135deg, rgba(15, 28, 48, 0.98), rgba(32, 74, 88, 0.96) 56%, rgba(44, 95, 72, 0.94));
  box-shadow: 0 20px 56px rgba(20, 32, 51, 0.18);
}

body.community-shell header.community-site-header::before,
body.community-shell header.community-site-header::after {
  display: none;
}

body.community-shell .community-header-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
}

body.community-shell header h1 {
  max-width: 12ch;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body.community-shell header #p {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08) !important;
}

body.community-shell .community-live-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

body.community-shell .community-live-pill {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #f8fbff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.community-shell .community-live-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

body.community-shell .community-live-row strong {
  color: #ffffff;
}

body.community-shell .community-live-row span {
  color: rgba(248, 251, 255, 0.72);
}

body.community-shell main.community-page {
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  gap: 18px;
}

body.community-shell main.community-page::before {
  display: none;
}

body.community-shell .community-toolbar,
body.community-shell .community-feed-card,
body.community-shell .community-thread-card,
body.community-shell .community-sidebar-card,
body.community-shell .community-thread-main-card,
body.community-shell .community-compose-card {
  overflow: hidden;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(20, 32, 51, 0.08);
}

body.community-shell .community-toolbar {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  align-items: end;
}

body.community-shell .community-toolbar h2,
body.community-shell .community-section-heading h2,
body.community-shell .community-compose-card h2 {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0;
}

body.community-shell .community-search-form,
body.community-shell .community-compose-form {
  display: grid;
  gap: 12px;
}

body.community-shell .community-search-form {
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 0.8fr) minmax(140px, 0.65fr) auto;
  align-items: end;
}

body.community-shell .community-compose-form {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr) minmax(180px, 0.55fr);
}

body.community-shell .community-field {
  display: grid;
  gap: 8px;
}

body.community-shell .community-field.is-wide {
  grid-column: 1 / -1;
}

body.community-shell .community-field span {
  color: #26364f;
  font-size: 0.86rem;
  font-weight: 800;
}

body.community-shell .community-field input,
body.community-shell .community-field select,
body.community-shell .community-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.14);
  background: #ffffff;
  color: #172033;
}

body.community-shell .community-field textarea {
  line-height: 1.55;
  resize: vertical;
}

body.community-shell .community-search-form button,
body.community-shell .community-compose-form button,
body.community-shell .community-reply-form button {
  border-radius: 8px;
  background: #172033;
  box-shadow: none;
}

body.community-shell .community-stat-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.community-shell .community-stat {
  padding: 14px;
  border-radius: 8px;
  background: #172033;
  color: #f8fbff;
}

body.community-shell .community-stat span {
  display: block;
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.community-shell .community-stat strong {
  display: block;
  color: #ffffff;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

body.community-shell .community-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
  align-items: start;
}

body.community-shell .community-front-layout,
body.community-shell .community-thread-view {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  align-items: start;
}

body.community-shell .community-thread-card {
  position: sticky;
  top: 96px;
}

body.community-shell .community-sidebar-card {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}

body.community-shell .community-thread-page {
  gap: 18px;
}

body.community-shell .community-section-heading {
  margin-bottom: 14px;
}

body.community-shell .community-post-list,
body.community-shell .community-comment-list {
  display: grid;
  gap: 12px;
}

body.community-shell .community-post-card {
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: #ffffff;
}

body.community-shell .community-post-card.is-selected {
  border-color: rgba(42, 111, 96, 0.45);
  box-shadow: inset 4px 0 0 rgba(42, 111, 96, 0.85);
}

body.community-shell .community-post-card button,
body.community-shell .community-post-card a {
  display: grid;
  justify-items: stretch;
  width: 100%;
  min-height: 0;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #172033 !important;
  text-align: left;
  text-decoration: none !important;
  box-shadow: none;
}

body.community-shell .community-post-card button:hover,
body.community-shell .community-post-card a:hover {
  transform: none;
  background: #f7faf8;
  box-shadow: none;
}

body.community-shell .community-post-card-top,
body.community-shell .community-post-meta,
body.community-shell .community-chip-row,
body.community-shell .community-comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
}

body.community-shell .community-chip-row {
  justify-content: flex-start;
}

body.community-shell .community-post-card strong,
body.community-shell .community-selected-post h3 {
  margin: 10px 0 6px;
  color: #172033;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.12rem;
  line-height: 1.25;
}

body.community-shell .community-post-excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: #546178;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
}

body.community-shell .community-post-meta {
  justify-content: flex-start;
  margin-top: 12px;
  color: #667085;
  font-size: 0.88rem;
  font-weight: 700;
}

body.community-shell .community-mini-badge,
body.community-shell .community-chip,
body.community-shell .community-reply-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4f7;
  color: #26364f;
  font-size: 0.78rem;
  font-weight: 800;
}

body.community-shell .community-mini-badge.is-pinned {
  background: #eaf6f0;
  color: #21493f;
}

body.community-shell .community-mini-badge.is-yours {
  background: #fff3d8;
  color: #775414;
}

body.community-shell .community-selected-post,
body.community-shell .community-empty {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: #f7faf8;
}

body.community-shell .community-thread-post-card {
  display: grid;
  gap: 14px;
}

body.community-shell .community-category-list {
  display: grid;
  gap: 10px;
}

body.community-shell .community-category-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: #ffffff;
  color: #172033 !important;
  box-shadow: none;
}

body.community-shell .community-category-list button:hover,
body.community-shell .community-category-list button.is-active {
  transform: none;
  border-color: rgba(42, 111, 96, 0.32);
  background: #eaf6f0;
  box-shadow: none;
}

body.community-shell .community-category-list span {
  color: #667085;
  font-size: 0.88rem;
  font-weight: 700;
}

body.community-shell .community-selected-post p,
body.community-shell .community-comment-card p {
  margin-bottom: 0;
  color: #3f4b5f;
}

body.community-shell .community-comments-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  margin-bottom: 10px;
}

body.community-shell .community-comments-head h3 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body.community-shell .community-comment-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  background: #ffffff;
}

body.community-shell .community-comment-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #172033;
  color: #ffffff;
  font-weight: 800;
  text-transform: uppercase;
}

body.community-shell .community-comment-head {
  justify-content: flex-start;
  margin-bottom: 6px;
}

body.community-shell .community-comment-head span {
  color: #667085;
  font-size: 0.88rem;
  font-weight: 700;
}

body.community-shell .community-reply-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

body.community-shell .community-reply-form button,
body.community-shell .community-compose-form button {
  width: fit-content;
  min-width: 130px;
}

body.community-shell footer {
  border-radius: 8px;
}

@media (max-width: 980px) {
  body.community-shell .community-header-grid,
  body.community-shell .community-toolbar,
  body.community-shell .community-layout,
  body.community-shell .community-front-layout,
  body.community-shell .community-thread-view {
    grid-template-columns: 1fr;
  }

  body.community-shell .community-thread-card,
  body.community-shell .community-sidebar-card {
    position: static;
  }

  body.community-shell .community-search-form,
  body.community-shell .community-compose-form {
    grid-template-columns: 1fr 1fr;
  }

  body.community-shell .community-search-form button,
  body.community-shell .community-field.is-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  body.community-shell > header,
  body.community-shell > main,
  body.community-shell > footer {
    width: calc(100% - 16px);
  }

  body.community-shell .community-search-form,
  body.community-shell .community-compose-form,
  body.community-shell .community-stat-row {
    grid-template-columns: 1fr;
  }

  body.community-shell .community-field.is-wide {
    grid-column: auto;
  }

  body.community-shell .community-live-row,
  body.community-shell .community-comments-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Dark theme pass for newer app pages */
body.marketplace-shell,
body.community-shell,
body.ai-chatbot-page {
  background:
    linear-gradient(180deg, #06101e 0%, #0b1728 46%, #07111f 100%);
  color: #e9f2fb;
}

body.marketplace-shell > header,
body.community-shell > header,
body.ai-chatbot-page > header {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(9, 18, 33, 0.98), rgba(15, 35, 55, 0.98) 58%, rgba(30, 79, 71, 0.96));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

body.marketplace-shell > footer,
body.community-shell > footer,
body.ai-chatbot-page > footer,
body.ai-chatbot-page .site-footer {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(10, 22, 38, 0.92);
  color: rgba(233, 242, 251, 0.78);
}

body.marketplace-shell header #p,
body.community-shell header #p,
body.ai-chatbot-page > header #p {
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(244, 249, 255, 0.86);
}

body.marketplace-shell main.marketplace-page,
body.community-shell main.community-page,
body.ai-chatbot-page main.html-ai-page {
  color: #e9f2fb;
}

body.marketplace-shell .marketplace-hero,
body.marketplace-shell .marketplace-category-panel,
body.marketplace-shell .marketplace-feed-card,
body.marketplace-shell .marketplace-detail-card,
body.marketplace-shell .marketplace-guide-card,
body.marketplace-shell .marketplace-create-card,
body.marketplace-shell .marketplace-deals-card,
body.marketplace-shell .marketplace-stat-card,
body.marketplace-shell .marketplace-deal-card,
body.community-shell .community-toolbar,
body.community-shell .community-feed-card,
body.community-shell .community-thread-card,
body.community-shell .community-sidebar-card,
body.community-shell .community-thread-main-card,
body.community-shell .community-compose-card,
body.ai-chatbot-page .assistant-sidebar-block,
body.ai-chatbot-page .assistant-chat-shell {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(14, 27, 46, 0.94);
  color: #e9f2fb;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

body.marketplace-shell .marketplace-hero {
  background:
    linear-gradient(135deg, rgba(14, 27, 46, 0.96), rgba(18, 43, 56, 0.96));
}

body.marketplace-shell .marketplace-section-heading h2,
body.marketplace-shell .marketplace-hero h2,
body.marketplace-shell .marketplace-guide-card h2,
body.community-shell .community-toolbar h2,
body.community-shell .community-section-heading h2,
body.community-shell .community-compose-card h2,
body.community-shell .community-comments-head h2,
body.ai-chatbot-page .assistant-chat-profile-copy h2,
body.ai-chatbot-page .assistant-sidebar-block h3 {
  color: #f8fbff;
}

body.marketplace-shell p,
body.marketplace-shell .status,
body.community-shell p,
body.community-shell .status,
body.community-shell .quiet-note,
body.ai-chatbot-page .assistant-chat-profile-copy p,
body.ai-chatbot-page .assistant-status,
body.ai-chatbot-page .assistant-count {
  color: rgba(221, 232, 244, 0.74);
}

body.marketplace-shell .label,
body.marketplace-shell .marketplace-mini-badge,
body.marketplace-shell .marketplace-chip,
body.marketplace-shell .marketplace-status-badge,
body.community-shell .label,
body.community-shell .community-mini-badge,
body.community-shell .community-chip,
body.community-shell .community-reply-count,
body.ai-chatbot-page .assistant-chat-eyebrow {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #9ddcc4;
}

body.marketplace-shell .marketplace-payment-note,
body.marketplace-shell .marketplace-detail-box,
body.marketplace-shell .marketplace-callout,
body.marketplace-shell .marketplace-deal-summary,
body.marketplace-shell .marketplace-empty,
body.marketplace-shell .marketplace-note-box,
body.marketplace-shell .marketplace-guide-list span,
body.community-shell .community-selected-post,
body.community-shell .community-empty,
body.community-shell .community-live-card,
body.community-shell .community-live-row,
body.ai-chatbot-page .assistant-connection-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(8, 18, 32, 0.72);
  color: rgba(233, 242, 251, 0.84);
}

body.marketplace-shell .marketplace-category-card,
body.marketplace-shell .marketplace-listing-card,
body.marketplace-shell .marketplace-deal-card,
body.community-shell .community-post-card,
body.community-shell .community-comment-card,
body.community-shell .community-category-list button,
body.ai-chatbot-page .assistant-prompt-chip {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(9, 20, 36, 0.88);
  color: #e9f2fb !important;
  box-shadow: none;
}

body.marketplace-shell .marketplace-category-card.is-active,
body.community-shell .community-category-list button:hover,
body.community-shell .community-category-list button.is-active,
body.ai-chatbot-page .assistant-prompt-chip:hover {
  border-color: rgba(84, 196, 151, 0.42);
  background: rgba(28, 76, 69, 0.72);
}

body.marketplace-shell .marketplace-listing-card.is-selected,
body.community-shell .community-post-card.is-selected {
  border-color: rgba(244, 157, 93, 0.52);
  box-shadow: inset 4px 0 0 rgba(244, 157, 93, 0.86);
}

body.marketplace-shell .marketplace-category-card strong,
body.marketplace-shell .marketplace-category-card span:last-child,
body.marketplace-shell .marketplace-listing-card h3,
body.marketplace-shell .marketplace-deal-card h3,
body.marketplace-shell #marketplace-selected h3,
body.marketplace-shell .marketplace-detail-box strong,
body.community-shell .community-post-card strong,
body.community-shell .community-selected-post h3,
body.community-shell .community-live-row strong,
body.community-shell .community-comment-head strong {
  color: #f8fbff;
}

body.marketplace-shell .marketplace-listing-card p,
body.marketplace-shell #marketplace-selected p,
body.marketplace-shell .marketplace-deal-card p,
body.community-shell .community-post-excerpt,
body.community-shell .community-post-meta,
body.community-shell .community-category-list span,
body.community-shell .community-selected-post p,
body.community-shell .community-comment-card p,
body.community-shell .community-comment-head span {
  color: rgba(221, 232, 244, 0.72);
}

body.marketplace-shell .marketplace-stat-card,
body.community-shell .community-stat,
body.ai-chatbot-page .assistant-chat-profile-avatar,
body.ai-chatbot-page .assistant-secondary-button {
  background: #13243c;
  color: #f8fbff;
}

body.marketplace-shell .marketplace-stat-card strong,
body.community-shell .community-stat strong {
  color: #ffffff;
}

body.marketplace-shell .marketplace-price {
  color: #ffb179;
}

body.marketplace-shell .marketplace-field span,
body.community-shell .community-field span {
  color: rgba(233, 242, 251, 0.82);
}

body.marketplace-shell .marketplace-field input,
body.marketplace-shell .marketplace-field select,
body.marketplace-shell .marketplace-field textarea,
body.community-shell .community-field input,
body.community-shell .community-field select,
body.community-shell .community-field textarea,
body.ai-chatbot-page .assistant-form textarea {
  border-color: rgba(255, 255, 255, 0.14);
  background: #091426;
  color: #f4f9ff;
}

body.marketplace-shell .marketplace-field input::placeholder,
body.marketplace-shell .marketplace-field textarea::placeholder,
body.community-shell .community-field input::placeholder,
body.community-shell .community-field textarea::placeholder,
body.ai-chatbot-page .assistant-form textarea::placeholder {
  color: rgba(221, 232, 244, 0.48);
}

body.marketplace-shell .marketplace-search-form button,
body.marketplace-shell .marketplace-card-actions button,
body.marketplace-shell .marketplace-card-actions a,
body.marketplace-shell .marketplace-deal-form button,
body.marketplace-shell .marketplace-create-card button,
body.marketplace-shell .marketplace-guide-card a,
body.community-shell .community-search-form button,
body.community-shell .community-compose-form button,
body.community-shell .community-reply-form button,
body.ai-chatbot-page .assistant-form button[type="submit"] {
  background: #f18a53;
  color: #111a29 !important;
  border-color: rgba(255, 205, 154, 0.45);
}

body.marketplace-shell .marketplace-search-form button:hover,
body.marketplace-shell .marketplace-card-actions button:hover,
body.marketplace-shell .marketplace-card-actions a:hover,
body.marketplace-shell .marketplace-deal-form button:hover,
body.marketplace-shell .marketplace-create-card button:hover,
body.marketplace-shell .marketplace-guide-card a:hover,
body.community-shell .community-search-form button:hover,
body.community-shell .community-compose-form button:hover,
body.community-shell .community-reply-form button:hover,
body.ai-chatbot-page .assistant-form button[type="submit"]:hover {
  background: #ff9d62;
}

body.ai-chatbot-page .assistant-chat-topbar,
body.ai-chatbot-page .assistant-form {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(9, 20, 36, 0.94);
}

body.ai-chatbot-page .assistant-messages,
html.html-ai-widget-mode body.ai-chatbot-page .assistant-messages {
  background: #07111f;
}

body.ai-chatbot-page .assistant-message-card,
body.ai-chatbot-page .assistant-message-user .assistant-message-card {
  border-color: rgba(255, 255, 255, 0.1);
  color: #e9f2fb;
}

body.ai-chatbot-page .assistant-message-user p,
body.ai-chatbot-page .assistant-message-user li,
body.ai-chatbot-page .assistant-message-body p,
body.ai-chatbot-page .assistant-message-body li {
  color: #e9f2fb;
}

body.ai-chatbot-page .assistant-message-user .assistant-message-body::before,
body.ai-chatbot-page .assistant-message-ai .assistant-message-body::before,
body.ai-chatbot-page .assistant-message-assistant .assistant-message-body::before {
  color: rgba(221, 232, 244, 0.62);
}

body.marketplace-shell :where(h1, h2, h3, h4, p, span, strong, label, legend, li, dt, dd, a, button, .status, .label),
body.community-shell :where(h1, h2, h3, h4, p, span, strong, label, legend, li, dt, dd, a, button, .status, .label),
body.ai-chatbot-page :where(h1, h2, h3, h4, p, span, strong, label, legend, li, dt, dd, a, button, .status, .label) {
  color: #f8fbff !important;
}

body.marketplace-shell :where(input, select, textarea),
body.community-shell :where(input, select, textarea),
body.ai-chatbot-page :where(input, select, textarea) {
  color: #ffffff !important;
}

body.marketplace-shell :where(input, textarea)::placeholder,
body.community-shell :where(input, textarea)::placeholder,
body.ai-chatbot-page :where(input, textarea)::placeholder {
  color: rgba(248, 251, 255, 0.62) !important;
}

body.lesson-protected {
  -webkit-user-select: none;
  user-select: none;
}

body.lesson-protected :where(.lesson-code, .lesson-code *, pre, pre *, code, kbd) {
  -webkit-user-select: text;
  user-select: text;
}
