:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --text: #18201c;
  --muted: #66706a;
  --line: #d9ded6;
  --line-strong: #c2cbc4;
  --surface: #ffffff;
  --surface-soft: #fbfcfa;
  --primary: #72c02c;
  --primary-dark: #4f941d;
  --accent: #146c5f;
  --accent-soft: #e8f2ee;
  --accent-strong: #0c4a42;
  --warn: #9f391b;
  --danger: #b42318;
  --page-pad: 24px;
  --content-max: 1120px;
  --reading-max: 760px;
  --radius: 8px;
  --shadow: 0 10px 28px rgba(24, 32, 28, 0.07);

  --ui-brand: #72c02c;
  --ui-brand-hover: #64ad26;
  --ui-brand-active: #579720;
  --ui-neutral: #475569;
  --ui-neutral-hover: #3d4a5c;
  --ui-neutral-active: #334155;
  --ui-subtle: #6b7280;
  --ui-subtle-hover: #5b6470;
  --ui-subtle-active: #4b5563;
  --ui-taupe: #d0c4be;
  --ui-taupe-hover: #bfb1aa;
  --ui-taupe-active: #ad9e97;
  --ui-info: #5b5bd6;
  --ui-info-hover: #4f4fc5;
  --ui-info-active: #4545b5;
  --ui-fresh: #0f766e;
  --ui-fresh-hover: #0d675f;
  --ui-fresh-active: #0b574f;
  --ui-attention: #f6c453;
  --ui-attention-hover: #e6b542;
  --ui-attention-active: #d5a534;
  --ui-orange: #f97316;
  --ui-orange-hover: #ea580c;
  --ui-orange-active: #c2410c;
  --ui-warning: #c2410c;
  --ui-warning-hover: #a93709;
  --ui-warning-active: #8f2f07;
  --ui-danger: #dc2626;
  --ui-danger-hover: #c51f1f;
  --ui-danger-active: #ab1919;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent-strong);
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(20, 108, 95, 0.35);
  outline-offset: 3px;
}

.container,
.narrow-container,
.test-container {
  width: min(var(--content-max), calc(100% - (var(--page-pad) * 2)));
  margin-inline: auto;
}

.narrow-container,
.test-container {
  max-width: var(--reading-max);
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: var(--page-pad);
  z-index: 100;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--text);
  color: var(--surface);
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid #d8ddd6;
  background: #ffffff;
}

.header-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  max-width: min(42vw, 260px);
  overflow: hidden;
  color: #10201a;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  color: var(--primary-dark);
}

.header-row > .brand {
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.header-account,
.account-user {
  position: relative;
  display: flex;
  align-items: center;
}

.account-login[hidden],
.account-user[hidden],
.account-menu[hidden] {
  display: none;
}

.account-icon {
  width: 20px;
  height: 20px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 210px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-menu-link {
  display: block;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.account-menu-link + .account-menu-link {
  border-top: 1px solid var(--line);
}

.account-menu-link:hover,
.account-menu-link:focus-visible {
  background: var(--accent-soft);
  color: var(--text);
}

.hamburger-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 16px;
}

.hamburger-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.hamburger-icon span:nth-child(1) { top: 0; }
.hamburger-icon span:nth-child(2) { top: 7px; }
.hamburger-icon span:nth-child(3) { top: 14px; }
.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.main-nav {
  position: absolute;
  top: 100%;
  right: calc(var(--page-pad) * -1);
  left: calc(var(--page-pad) * -1);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px var(--page-pad);
  border-bottom: 1px solid #d8ddd6;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(24, 32, 28, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  visibility: hidden;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.main-nav[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 700;
  line-height: 1.22;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--accent-soft);
  color: var(--text);
}

#main {
  min-height: 60vh;
}

.hero,
.page-hero {
  background: transparent;
}

.hero-inner,
.page-hero > .container {
  max-width: var(--reading-max);
  padding-top: 32px;
  padding-bottom: 24px;
}

.eyebrow,
.card-kicker {
  display: block;
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow:not(.badge),
.card-kicker:not(.badge) {
  text-transform: uppercase;
}

.eyebrow.badge,
.card-kicker.badge {
  display: block;
  width: fit-content;
  max-width: 100%;
  align-self: flex-start;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}

.unavailable .eyebrow {
  color: var(--warn);
}

h1,
h2,
h3 {
  overflow-wrap: anywhere;
  line-height: 1.14;
}

.hero h1,
.page-hero h1,
.article-card h1,
.test-card h1,
.article-submit-card h1,
.status-card h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.5rem);
  letter-spacing: -0.035em;
}

.hero p,
.page-hero p,
.article-submit-intro,
.status-card p {
  color: var(--muted);
}

.hero p,
.page-hero p {
  margin: 14px 0 0;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-width: 720px;
  margin: 22px 0 0;
}

.search-box input,
.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.search-box input {
  min-height: 46px;
  padding: 0 14px;
}

.search-box input:focus-visible,
.form-field input:focus-visible,
.form-field textarea:focus-visible {
  border-color: var(--primary);
  outline: 3px solid rgba(114, 192, 44, 0.28);
  outline-offset: 2px;
}

.search-box .button {
  justify-self: end;
}

.section {
  padding: 24px 0 40px;
}

.section-soft {
  border-block: 1px solid var(--line);
  background: var(--surface-soft);
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.section-heading > :first-child,
.section-heading > h2 {
  margin-right: auto;
}

.section-heading h2 {
  margin-top: 0;
  margin-bottom: 0;
  font-size: clamp(1.35rem, 5vw, 1.8rem);
}

.text-link,
.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
  color: var(--accent);
  font-weight: 800;
  text-align: right;
}

.card-grid,
.category-grid,
.category-list-grid,
.listing,
.question-list,
.user-article-list,
.search-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.content-card,
.list-card,
.category-detail-card,
.category-card,
.user-article-card,
.question-card,
.aside-box,
.sidebar,
.stack-list,
.quiz-panel,
.test-card,
.article-submit-card,
.status-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.content-card,
.list-card,
.category-detail-card,
.user-article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

a.content-card,
a.list-card,
a.content-card:hover,
a.list-card:hover {
  color: var(--text);
  text-decoration: none;
}

.content-card:hover,
.list-card:hover,
.category-detail-card:hover,
.user-article-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.content-card:focus-visible,
.list-card:focus-visible {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.content-card h3,
.list-card h2,
.category-detail-card h2,
.user-article-card h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.2rem;
}

.content-card h3 a,
.list-card h2 a,
.category-detail-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.content-card .card-link,
.list-card .card-link,
.category-detail-card .card-link {
  align-self: flex-end;
  margin-top: auto;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.content-card:hover .card-link,
.list-card:hover .card-link {
  color: var(--accent-strong);
}

.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.category-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateY(-1px);
}

.category-card small,
.sidebar small,
.user-article-card time {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.count-badge {
  display: inline-flex;
  min-width: 32px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  padding: 4px 8px;
  border: 1px solid var(--ui-taupe);
  border-radius: 999px;
  background: var(--surface);
  color: #111111;
  font-size: 12px;
  font-weight: 700;
}

.category-description,
.user-article-card p {
  color: var(--muted);
}

.split-grid,
.content-layout,
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.stack-list {
  overflow: hidden;
}

.stack-list > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.stack-list > a:last-child {
  border-bottom: 0;
}

.stack-list > a:hover,
.stack-list > a:focus-visible {
  background: var(--accent-soft);
  color: var(--text);
}

.quiz-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 18px;
}

.quiz-panel h2,
.quiz-panel p {
  align-self: stretch;
}

.quiz-panel h2 {
  margin: 0;
}

.quiz-panel p {
  color: var(--muted);
}

.content-layout > div,
.article-layout > * {
  min-width: 0;
}

.sidebar {
  overflow: hidden;
}

.sidebar h2,
.aside-box h2 {
  margin: 0;
  font-size: 1.15rem;
}

.sidebar h2 {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar nav a,
.related-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.sidebar nav a:hover,
.related-list a:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.pagination .current {
  pointer-events: none;
}

.pagination-gap {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  color: var(--muted);
}

.article-shell,
.article-submit-shell,
.status-page {
  padding: 28px 0 56px;
}

.article-card {
  --document-export-bottom: calc(12px + env(safe-area-inset-bottom));
  min-width: 0;
  max-width: var(--reading-max);
  margin-inline: auto;
}

.article-layout .article-card {
  margin-inline: 0;
}

.article-card h1,
.test-card h1 {
  margin-bottom: 28px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  color: var(--muted);
  font-size: 0.86rem;
  scrollbar-width: none;
  white-space: nowrap;
}

.breadcrumbs::-webkit-scrollbar {
  display: none;
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  text-decoration: none;
}

.article-body,
.plan-body {
  color: #263229;
  font-size: 1.05rem;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.article-reading-surface {
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.article-body.article-reading-surface {
  padding-bottom: calc(clamp(18px, 4vw, 36px) + var(--document-export-height, 66px) + var(--document-export-bottom));
}

.article-copy-status {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.article-copy-status[hidden] {
  display: none;
}

.article-body--text,
.plan-body {
  white-space: pre-wrap;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.6em 0 0.6em;
  line-height: 1.25;
}

.article-body p {
  margin: 0 0 1.2em;
}

.article-body a {
  color: var(--accent);
}

.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.article-body th,
.article-body td {
  padding: 10px;
  border: 1px solid var(--line);
}

.article-body blockquote {
  margin: 1.4em 0;
  padding: 10px 16px;
  border-left: 3px solid var(--primary);
  background: var(--surface-soft);
}

.content-metadata {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 20px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

.content-metadata p {
  margin: 0;
}

.content-metadata-divider {
  margin: 28px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.content-metadata-divider + .content-metadata {
  margin-top: 0;
  border-top: 0;
}

.document-export {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 24px;
}

.document-export--fixed {
  --document-export-boundary-offset: 0px;
  --document-export-inline-center: 50%;
  --document-export-inline-max: calc(100vw - 24px);
  position: fixed;
  left: var(--document-export-inline-center);
  bottom: calc(var(--document-export-bottom) + var(--document-export-boundary-offset));
  z-index: 30;
  max-width: min(calc(100vw - 24px), var(--document-export-inline-max));
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.document-export-status {
  max-width: min(420px, calc(100vw - 48px));
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.document-export-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.document-export-links[hidden] {
  display: none;
}

.document-subscription-dialog {
  width: min(calc(100% - 32px), 460px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(24, 33, 47, 0.24);
}

.document-subscription-dialog::backdrop {
  background: rgba(23, 32, 51, 0.48);
}

.document-subscription-dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0.4;
}

.document-subscription-dialog-close:hover,
.document-subscription-dialog-close:focus-visible {
  opacity: 0.8;
}

.document-subscription-dialog p {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.document-subscription-dialog-close + p {
  margin-top: 12px;
}

.document-subscription-dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.article-aside {
  display: grid;
  gap: 14px;
}

.aside-box {
  padding: 16px;
}

.related-list {
  display: grid;
  margin-top: 8px;
}

.related-list a {
  padding-inline: 0;
}

.question-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.question-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateY(-1px);
}

.question-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.test-card,
.article-submit-card,
.status-card {
  padding: 20px;
}

.answer-form fieldset {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
}

.answer-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.answer-option:has(input:checked) {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.answer-option.correct,
.answer-option.correct:has(input:checked) {
  border-color: var(--primary-dark);
  background: #eef8e7;
}

.answer-option.incorrect,
.answer-option.incorrect:has(input:checked) {
  border-color: var(--danger);
  background: #fff0ed;
}

.answer-option input {
  margin-top: 5px;
  accent-color: var(--accent);
}

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

.answer-indicator,
.form-error,
.field-error {
  font-size: 0.88rem;
  font-weight: 700;
}

.answer-indicator.correct { color: #437a18; }
.answer-indicator.incorrect,
.form-error,
.field-error { color: var(--danger); }

.answer-result {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
}

.answer-result[hidden] {
  display: none;
}

.answer-result.loading {
  background: var(--surface-soft);
  color: var(--muted);
}

.answer-form[aria-busy="true"] .answer-option {
  cursor: progress;
  opacity: 0.7;
}

.test-actions,
.article-submit-actions,
.status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.article-submit-card {
  max-width: var(--reading-max);
  margin-inline: auto;
}

.article-submit-intro {
  margin: 12px 0 24px;
}

.article-submit-form {
  display: grid;
  gap: 20px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-weight: 800;
}

.form-field input,
.form-field textarea {
  padding: 11px 13px;
}

.form-field textarea {
  min-height: 240px;
  line-height: 1.6;
  resize: vertical;
}

.form-field [aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 0;
}

.form-alert,
.form-success,
.empty-state {
  padding: 14px;
  border-radius: var(--radius);
}

.form-alert {
  border: 1px solid #e7b9b5;
  background: #fff0ed;
}

.form-success {
  border: 1px solid #cde7bc;
  background: #eef8e7;
  color: #437a18;
  font-weight: 700;
}

.form-success p {
  margin: 0;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  color: var(--muted);
}

.user-article-card time {
  display: block;
  margin-bottom: 6px;
}

.user-article-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-page {
  padding-block: 28px 56px;
}

.profile-head {
  max-width: 720px;
  margin-bottom: 24px;
}

.profile-head h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.25rem, 10vw, 3.25rem);
  line-height: 1.08;
}

.profile-head p,
.profile-muted {
  color: var(--muted);
}

.profile-head p {
  margin: 0;
}

.profile-layout {
  display: grid;
  gap: 16px;
}

.profile-card {
  display: grid;
  align-content: start;
  gap: 24px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.profile-avatar {
  display: grid;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  overflow: hidden;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 850;
  line-height: 1;
}

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

.profile-avatar img[hidden],
.profile-avatar [hidden],
.profile-inline-value[hidden],
.profile-inline-form[hidden] {
  display: none;
}

.profile-summary-text {
  min-width: 0;
}

.profile-summary-text h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.45rem;
  line-height: 1.2;
}

.profile-summary-text p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.profile-balance-section {
  display: grid;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.profile-balance-section h2 {
  margin: 4px 0 0;
  font-size: 1.2rem;
}

.profile-balances {
  display: grid;
  gap: 12px;
  margin: 0;
}

.profile-balances > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.profile-balances dt {
  color: var(--muted);
  font-weight: 700;
}

.profile-balances dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.profile-balances dd strong {
  color: var(--primary-dark);
  font-size: 1.35rem;
}

.profile-details {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.profile-detail-row {
  display: grid;
  gap: 6px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.profile-detail-row dt {
  color: var(--muted);
  font-weight: 700;
}

.profile-detail-row dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.profile-inline-value {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.profile-edit-button {
  margin-left: auto;
}

.profile-inline-form {
  display: grid;
  gap: 10px;
}

.profile-inline-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-weight: 650;
}

.profile-inline-input:focus-visible {
  border-color: var(--primary);
  outline-color: rgba(114, 192, 44, 0.35);
}

.profile-inline-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.profile-inline-actions,
.profile-actions,
.profile-subscription-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-field-status {
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}

.profile-field-status.is-success {
  color: var(--primary-dark);
}

.profile-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 4px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.2;
}

.profile-status-badge > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
}

.profile-status-badge.is-active {
  border-color: #cde7bc;
  background: #f2faec;
  color: var(--primary-dark);
}

.profile-status-badge.is-active > span {
  background: var(--primary);
}

.profile-subscription-card h2 {
  margin: 6px 0 0;
  font-size: 1.35rem;
}

.profile-subscriptions {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-subscriptions li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.profile-muted {
  margin: 0;
}

.profile-subscription-actions {
  align-self: end;
  margin-top: auto;
}

.profile-noscript {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  color: var(--muted);
}

@media (min-width: 768px) {
  .profile-page {
    padding-block: 40px 72px;
  }

  .profile-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
    align-items: start;
    gap: 20px;
  }

  .profile-card {
    padding: 24px;
  }

  .profile-detail-row {
    grid-template-columns: minmax(145px, 0.36fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
  }

  .profile-balances {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.status-page {
  display: grid;
  min-height: 65vh;
  place-items: center;
  padding-inline: var(--page-pad);
}

.status-card {
  width: min(100%, 660px);
}

.status-code {
  display: block;
  color: var(--primary-dark);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
}

.status-card h1 {
  margin-top: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-block: 8px;
}

.footer-group {
  min-width: 0;
  padding-block: 24px;
}

.footer-group + .footer-group {
  border-top: 1px solid var(--line);
}

.footer-brand-group {
  max-width: 36rem;
}

.footer-brand {
  flex: none;
  max-width: 100%;
  overflow: visible;
  color: var(--text);
  font-size: 1.5rem;
}

.footer-description {
  max-width: 32rem;
  margin: 8px 0 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.footer-heading {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  justify-items: end;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
  text-align: right;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  background: rgba(114, 192, 44, 0.1);
  color: var(--primary-dark);
}

.copyright {
  padding-block: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  text-align: right;
}

@media (max-width: 420px) {
  :root {
    --page-pad: 16px;
  }

  .header-row {
    flex-wrap: wrap;
    padding-block: 10px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-search {
    --button-padding-x: 10px;
  }
}

@media (min-width: 560px) {
  .search-box {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .card-grid,
  .category-grid,
  .category-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .header-row {
    gap: 20px;
  }

  .brand {
    flex: 0 1 auto;
    max-width: min(24vw, 260px);
  }

  .header-actions {
    order: 3;
  }

  .menu-toggle.button {
    display: none;
  }

  .main-nav {
    position: static;
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .main-nav a {
    position: relative;
    width: auto;
    min-height: 40px;
    padding: 8px 10px;
  }

  .hero-inner,
  .page-hero > .container {
    padding-top: 40px;
    padding-bottom: 30px;
  }

  .hero h1,
  .page-hero h1,
  .article-card h1,
  .test-card h1,
  .article-submit-card h1,
  .status-card h1 {
    font-size: clamp(2.6rem, 6vw, 3.8rem);
  }

  .section {
    padding: 32px 0 56px;
  }

  .split-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  }

  .content-layout,
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 30px;
  }

  .sidebar,
  .article-aside {
    position: sticky;
    top: 88px;
  }

  .article-shell,
  .article-submit-shell,
  .status-page {
    padding-top: 40px;
    padding-bottom: 72px;
  }

  .test-card,
  .article-submit-card,
  .status-card {
    padding: 28px;
  }

  .article-card {
    --document-export-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 1fr);
    align-items: start;
    gap: 32px;
    padding-block: 40px;
  }

  .footer-group {
    padding-block: 0;
  }

  .footer-group + .footer-group {
    border-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hamburger-icon span,
  .main-nav,
  .content-card,
  .list-card,
  .category-detail-card,
  .category-card,
  .user-article-card,
  .question-card {
    transition: none;
  }
}

/* Shared buttons, circle buttons, and badges. Page selectors may position these components but must not restyle them. */
.button,
.badge {
  --component-color: var(--ui-brand);
  --component-hover: var(--ui-brand-hover);
  --component-active: var(--ui-brand-active);
}

.button[data-color="brand"],
.badge[data-color="brand"] {
  --component-color: var(--ui-brand);
  --component-hover: var(--ui-brand-hover);
  --component-active: var(--ui-brand-active);
}

.button[data-color="neutral"],
.badge[data-color="neutral"] {
  --component-color: var(--ui-neutral);
  --component-hover: var(--ui-neutral-hover);
  --component-active: var(--ui-neutral-active);
}

.button[data-color="subtle"],
.badge:not([data-color]),
.badge[data-color="subtle"] {
  --component-color: var(--ui-subtle);
  --component-hover: var(--ui-subtle-hover);
  --component-active: var(--ui-subtle-active);
}

.button[data-color="taupe"],
.badge[data-color="taupe"] {
  --component-color: var(--ui-taupe);
  --component-hover: var(--ui-taupe-hover);
  --component-active: var(--ui-taupe-active);
}

.button[data-color="info"],
.badge[data-color="info"] {
  --component-color: var(--ui-info);
  --component-hover: var(--ui-info-hover);
  --component-active: var(--ui-info-active);
}

.button[data-color="fresh"],
.badge[data-color="fresh"] {
  --component-color: var(--ui-fresh);
  --component-hover: var(--ui-fresh-hover);
  --component-active: var(--ui-fresh-active);
}

.button[data-color="attention"],
.badge[data-color="attention"] {
  --component-color: var(--ui-attention);
  --component-hover: var(--ui-attention-hover);
  --component-active: var(--ui-attention-active);
}

.button[data-color="orange"],
.badge[data-color="orange"] {
  --component-color: var(--ui-orange);
  --component-hover: var(--ui-orange-hover);
  --component-active: var(--ui-orange-active);
}

.button[data-color="warning"],
.badge[data-color="warning"] {
  --component-color: var(--ui-warning);
  --component-hover: var(--ui-warning-hover);
  --component-active: var(--ui-warning-active);
}

.button[data-color="danger"],
.badge[data-color="danger"] {
  --component-color: var(--ui-danger);
  --component-hover: var(--ui-danger-hover);
  --component-active: var(--ui-danger-active);
}

.button[data-label-weight="regular"],
.badge[data-label-weight="regular"] {
  --component-label-weight: 400;
}

.button:not([data-emphasis="gradient"])[data-label-weight="bold"],
.badge[data-label-weight="bold"] {
  --component-label-weight: 700;
}

.button:not([data-emphasis="gradient"])[data-label-color="black"],
.badge[data-label-color="black"] {
  --component-label-color: #111111;
  --component-label-hover: #111111;
  --component-label-active: #111111;
}

.button:not([data-emphasis="gradient"])[data-label-color="white"],
.badge[data-label-color="white"] {
  --component-label-color: #ffffff;
  --component-label-hover: #ffffff;
  --component-label-active: #ffffff;
}

.button:not([data-emphasis="gradient"])[data-label-color="native"],
.badge[data-label-color="native"] {
  --component-label-color: var(--component-color);
  --component-label-hover: var(--component-hover);
  --component-label-active: var(--component-active);
}

.button {
  --button-height: 44px;
  --button-padding-x: 18px;
  --button-font-size: 15px;
  --button-gap: 8px;
  --button-radius: 10px;
  --button-icon-size: 18px;
  --button-spinner-color: var(--component-label-color, #ffffff);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--button-gap);
  height: var(--button-height);
  min-height: 0;
  padding: 0 var(--button-padding-x);
  border-radius: var(--button-radius);
  font-family: inherit;
  font-size: var(--button-font-size);
  font-weight: var(--component-label-weight, 700);
  line-height: 1;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.button[hidden] { display: none; }

.button[data-size="big"] {
  --button-height: 52px;
  --button-padding-x: 24px;
  --button-font-size: 18px;
  --button-gap: 10px;
  --button-radius: 12px;
  --button-icon-size: 22px;
}

.button:not([data-size]),
.button[data-size="normal"] {
  --button-height: 44px;
  --button-padding-x: 18px;
  --button-font-size: 15px;
  --button-gap: 8px;
  --button-radius: 10px;
  --button-icon-size: 18px;
}

.button[data-size="small"] {
  --button-height: 34px;
  --button-padding-x: 12px;
  --button-font-size: 13px;
  --button-gap: 6px;
  --button-radius: 8px;
  --button-icon-size: 16px;
}

.button[data-size="tiny"] {
  --button-height: 28px;
  --button-padding-x: 9px;
  --button-font-size: 12px;
  --button-gap: 5px;
  --button-radius: 7px;
  --button-icon-size: 14px;
}

.button[data-size="micro"] {
  --button-height: 24px;
  --button-padding-x: 7px;
  --button-font-size: 11px;
  --button-gap: 4px;
  --button-radius: 6px;
  --button-icon-size: 12px;
}

.button[data-icon-only="true"] {
  width: var(--button-height);
  min-width: var(--button-height);
  padding: 0;
}

.button[data-full-width="true"] { width: 100%; }

.button[data-wrap="true"] {
  height: auto;
  min-height: var(--button-height);
  white-space: normal;
}

.button[data-wrap="true"] .button-label { overflow-wrap: anywhere; }

.circle-button {
  width: var(--button-height);
  min-width: var(--button-height);
  height: var(--button-height);
  flex-shrink: 0;
  padding: 0;
  border-radius: 50%;
}

.button .ui-icon,
.ui-icon,
.document-export-icon {
  display: block;
  width: var(--button-icon-size, 18px);
  height: var(--button-icon-size, 18px);
  max-width: none;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button:not([data-variant]),
.button[data-variant="filled"],
.badge[data-variant="filled"] {
  color: var(--component-label-color, #ffffff);
  background: var(--component-color);
  border: 1px solid var(--component-color);
}

.button:not([data-variant]),
.button[data-variant="filled"] {
  box-shadow: 0 8px 18px color-mix(in srgb, var(--component-color) 17%, transparent);
}

.button[data-color="attention"]:not([data-variant]),
.button[data-color="attention"][data-variant="filled"] {
  --button-spinner-color: var(--component-label-color, #111111);
  color: var(--component-label-color, #111111);
}

.button:not([data-variant]):hover:not(:disabled):not([aria-disabled="true"]),
.button[data-variant="filled"]:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--component-label-hover, #ffffff);
  background: var(--component-hover);
  border-color: var(--component-hover);
}

.button[data-color="attention"]:not([data-variant]):hover:not(:disabled):not([aria-disabled="true"]),
.button[data-color="attention"][data-variant="filled"]:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--component-label-hover, #111111);
}

.button:not([data-variant]):active:not(:disabled):not([aria-disabled="true"]),
.button[data-variant="filled"]:active:not(:disabled):not([aria-disabled="true"]) {
  color: var(--component-label-active, #ffffff);
  background: var(--component-active);
  border-color: var(--component-active);
}

.button[data-color="attention"]:not([data-variant]):active:not(:disabled):not([aria-disabled="true"]),
.button[data-color="attention"][data-variant="filled"]:active:not(:disabled):not([aria-disabled="true"]) {
  color: var(--component-label-active, #111111);
}

.button[data-variant="border"],
.badge:not([data-variant]),
.badge[data-variant="border"] {
  --button-spinner-color: var(--component-label-color, var(--component-color));
  color: var(--component-label-color, #111111);
  background: #ffffff;
  border: 1px solid var(--component-color);
}

.button[data-variant="border"]:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--component-label-hover, #111111);
  background: #f8faf8;
  border-color: var(--component-hover);
}

.button[data-variant="border"]:active:not(:disabled):not([aria-disabled="true"]) {
  color: var(--component-label-active, #111111);
  background: #f1f4f1;
  border-color: var(--component-active);
}

.button[data-variant="ghost"] {
  --button-spinner-color: var(--component-label-color, var(--component-color));
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  color: var(--component-label-color, var(--component-color));
}

.button[data-variant="ghost"]:hover:not(:disabled):not([aria-disabled="true"]) {
  border-color: transparent;
  background: color-mix(in srgb, var(--component-color) 9%, transparent);
  color: var(--component-label-hover, var(--component-hover));
}

.button[data-variant="ghost"]:active:not(:disabled):not([aria-disabled="true"]) {
  border-color: transparent;
  background: color-mix(in srgb, var(--component-color) 15%, transparent);
  color: var(--component-label-active, var(--component-active));
}

.button[aria-pressed="true"]:not([data-variant="ghost"]) {
  color: var(--component-label-color, #ffffff);
  background: var(--component-color);
  border-color: var(--component-color);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--component-color) 17%, transparent);
}

.button[aria-pressed="true"]:not([data-variant="ghost"]):hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--component-label-hover, #ffffff);
  background: var(--component-hover);
  border-color: var(--component-hover);
}

.button[data-variant="ghost"][aria-pressed="true"],
.button[data-variant="ghost"][aria-expanded="true"] {
  border-color: transparent;
  background: color-mix(in srgb, var(--component-color) 13%, transparent);
  color: var(--component-label-color, var(--component-color));
  box-shadow: none;
}

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="brand"]:not([data-color]):not([data-label-color]) {
  --gradient-shadow: #0f766e;
  background: linear-gradient(135deg, #3f861a 0%, #0f766e 100%);
}

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="brand"]:not([data-color]):not([data-label-color]):hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #347315 0%, #0d675f 100%); }
.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="brand"]:not([data-color]):not([data-label-color]):active:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #2b6112 0%, #0b574f 100%); }

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="ai"]:not([data-color]):not([data-label-color]) {
  --gradient-shadow: #6366f1;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="ai"]:not([data-color]):not([data-label-color]):hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%); }
.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="ai"]:not([data-color]):not([data-label-color]):active:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #3730a3 0%, #5b21b6 100%); }

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="fresh"]:not([data-color]):not([data-label-color]) {
  --gradient-shadow: #0e7490;
  background: linear-gradient(135deg, #0f766e 0%, #0e7490 100%);
}

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="fresh"]:not([data-color]):not([data-label-color]):hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #0d675f 0%, #0c647a 100%); }
.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="fresh"]:not([data-color]):not([data-label-color]):active:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #0b574f 0%, #0a5366 100%); }

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="premium"]:not([data-color]):not([data-label-color]) {
  --gradient-shadow: #be185d;
  background: linear-gradient(135deg, #7e22ce 0%, #be185d 100%);
}

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="premium"]:not([data-color]):not([data-label-color]):hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #6b21a8 0%, #9d174d 100%); }
.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="premium"]:not([data-color]):not([data-label-color]):active:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #581c87 0%, #831843 100%); }

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="bigorange"]:not([data-color]):not([data-label-color]) {
  --gradient-shadow: #f4511e;
  background: linear-gradient(135deg, #ff9a2f 0%, #f4511e 100%);
}

.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="bigorange"]:not([data-color]):not([data-label-color]):hover:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #f58b20 0%, #dc4317 100%); }
.button[data-emphasis="gradient"][data-variant="filled"][data-gradient="bigorange"]:not([data-color]):not([data-label-color]):active:not(:disabled):not([aria-disabled="true"]) { background: linear-gradient(135deg, #e87d17 0%, #c83a13 100%); }

.button[data-emphasis="gradient"][data-variant="filled"]:not([data-color]):not([data-label-color]):is([data-gradient="brand"], [data-gradient="ai"], [data-gradient="fresh"], [data-gradient="premium"], [data-gradient="bigorange"]) {
  --button-focus-color: var(--gradient-shadow);
  color: #ffffff;
  border-color: transparent;
  background-clip: padding-box;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--gradient-shadow) 24%, transparent);
}

.button[data-emphasis="gradient"][data-variant="filled"]:not([data-color]):not([data-label-color]):is([data-gradient="brand"], [data-gradient="ai"], [data-gradient="fresh"], [data-gradient="premium"], [data-gradient="bigorange"]):hover:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--gradient-shadow) 30%, transparent);
}

.button[data-emphasis="gradient"][data-variant="filled"]:not([data-color]):not([data-label-color]):is([data-gradient="brand"], [data-gradient="ai"], [data-gradient="fresh"], [data-gradient="premium"], [data-gradient="bigorange"]):active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(0);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--gradient-shadow) 24%, transparent);
}

.button:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-1px); }
.button:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(0); }

.button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--button-focus-color, var(--component-color)) 30%, transparent);
  outline-offset: 2px;
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
  pointer-events: none;
}

.button[aria-busy="true"] {
  color: transparent;
  cursor: wait;
  pointer-events: none;
  transform: none;
}

.button[aria-busy="true"] > * { opacity: 0; }

.button[aria-busy="true"]::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(18px, calc(var(--button-height) - 8px));
  height: min(18px, calc(var(--button-height) - 8px));
  border: 2px solid color-mix(in srgb, var(--button-spinner-color) 32%, transparent);
  border-top-color: var(--button-spinner-color);
  border-radius: 999px;
  content: "";
  transform: translate(-50%, -50%);
  animation: ui-button-spin 700ms linear infinite;
}

@keyframes ui-button-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.badge,
.count-badge,
.profile-status-badge {
  text-transform: lowercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: var(--component-label-weight, 400);
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

.badge[data-size="small"] { min-height: 22px; padding: 3px 8px; font-size: 12px; }
.badge[data-size="tiny"] { min-height: 20px; padding: 3px 7px; font-size: 11px; }
.badge[data-size="micro"] { min-height: 18px; padding: 2px 6px; font-size: 10px; }

.badge-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--component-color);
}

@media (pointer: coarse) {
  .button[data-size="small"]::before,
  .button[data-size="tiny"]::before,
  .button[data-size="micro"]::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, 40px);
    height: max(100%, 40px);
    content: "";
    transform: translate(-50%, -50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:hover:not(:disabled):not([aria-disabled="true"]),
  .button:active:not(:disabled):not([aria-disabled="true"]) { transform: none; }
  .button[aria-busy="true"]::after { animation-duration: 1.4s; }
}

@media (forced-colors: active) {
  .button,
  .badge {
    border-color: ButtonText;
    forced-color-adjust: auto;
  }

  .button:focus-visible { outline-color: Highlight; }
  .badge-dot { background: CanvasText; }
}

.content-question-teaser {
  display: grid;
  gap: 16px;
  margin: 24px 0 32px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.content-question-teaser h2,
.content-question-teaser p {
  margin: 0;
}

.content-question-teaser h2 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.content-question-teaser p,
.content-questions-head p,
.content-question-help,
.content-question-panel-head p,
.content-question-answer-meta {
  color: var(--muted);
}

.content-question-teaser-actions,
.content-question-form-actions,
.content-question-archive-actions,
.content-question-login > div {
  display: flex;
  justify-content: flex-end;
}

.content-questions-page {
  display: grid;
  gap: 28px;
}

.content-questions-back {
  justify-self: start;
}

.content-questions-head h1,
.content-questions-head p,
.content-question-panel h2,
.content-question-panel-head p,
.content-question-archive h2 {
  margin-top: 0;
}

.content-questions-head p,
.content-question-panel-head p {
  margin-bottom: 0;
}

.content-question-panel,
.content-question-answer {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.content-question-panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.content-question-panel-head h2 {
  margin-bottom: 0;
}

.content-question-form {
  display: grid;
  gap: 10px;
}

.content-question-form label {
  font-weight: 700;
}

.content-question-form select,
.content-question-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.content-question-form textarea {
  min-height: 112px;
  resize: vertical;
}

.content-question-form select:focus-visible,
.content-question-form textarea:focus-visible {
  border-color: var(--primary);
  outline: 3px solid rgba(114, 192, 44, 0.28);
  outline-offset: 2px;
}

.content-question-help,
.content-question-status {
  margin: 0;
  font-size: 0.9rem;
}

.content-question-status:not(:empty) {
  padding-top: 4px;
  color: var(--danger);
  font-weight: 700;
}

.content-question-status[data-tone="success"],
.content-question-form[aria-busy="true"] .content-question-status:not(:empty) {
  color: #437a18;
}

.content-question-live-answer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.content-question-live-answer h3 {
  margin-top: 0;
}

.content-question-loading {
  display: flex;
  gap: 5px;
  margin-top: 14px;
}

.content-question-loading[hidden] {
  display: none;
}

.content-question-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.content-question-answer-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.content-question-answer-list[hidden] {
  display: none;
}

.content-question-answer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.content-question-answer-question {
  margin-bottom: 12px;
}

.content-question-answer-question summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  overflow-wrap: anywhere;
}

.content-question-answer-question summary::-webkit-details-marker {
  display: none;
}

.content-question-answer-text {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.content-question-answer-text > :first-child {
  margin-top: 0;
}

.content-question-answer-text > :last-child {
  margin-bottom: 0;
}

.content-question-answer-text table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.content-question-archive {
  display: grid;
  gap: 14px;
}

.content-question-archive h2 {
  margin-bottom: 0;
}

.content-question-private-archive {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.content-question-login {
  display: grid;
  gap: 14px;
}

.content-question-login > div {
  justify-content: center;
}

.content-question-login p {
  margin: 0;
}

@media (min-width: 640px) {
  .content-question-teaser {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 20px;
  }

  .content-question-panel-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
  }
}

/* Detail-page engagement */
.content-engagement {
  position: relative;
  display: grid;
  justify-items: end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.content-engagement-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.content-engagement-status,
.engagement-feedback-status,
.comments-status,
.comment-composer-status,
.comment-item-status {
  min-height: 1.35em;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.content-engagement-status[data-tone="success"],
.engagement-feedback-status[data-tone="success"],
.comments-status[data-tone="success"] {
  color: #437a18;
}

.content-engagement-status[data-tone="error"],
.engagement-feedback-status[data-tone="error"],
.comments-status[data-tone="error"],
.comment-item-status[data-tone="error"] {
  color: #b42318;
}

.engagement-share-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  top: 66px;
  display: grid;
  width: min(260px, calc(100vw - 40px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(23, 42, 17, 0.18);
}

.engagement-share-menu[hidden],
.engagement-feedback-sheet[hidden],
.engagement-comments [hidden] {
  display: none;
}

.engagement-share-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: #fff;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.engagement-share-option:last-child {
  border-bottom: 0;
}

.engagement-share-option:hover,
.engagement-share-option:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.has-engagement-dialog {
  overflow: hidden;
}

.engagement-feedback-sheet {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.engagement-feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 16, 0.55);
}

.engagement-feedback-dialog {
  position: relative;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  background: #fff;
  padding: 18px;
  box-shadow: 0 -20px 60px rgba(17, 24, 16, 0.22);
}

.engagement-feedback-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.engagement-feedback-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.engagement-feedback-form {
  display: grid;
  gap: 16px;
}

.engagement-feedback-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.engagement-feedback-form legend,
.engagement-feedback-comment span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.engagement-feedback-reasons {
  display: grid;
  gap: 8px;
}

.engagement-feedback-reason {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.engagement-feedback-reason:has(input:checked) {
  border-color: #72c02c;
  background: var(--accent-soft);
}

.engagement-feedback-reason input {
  width: 18px;
  height: 18px;
  accent-color: #72c02c;
}

.engagement-feedback-comment textarea,
.comment-composer textarea,
.comment-inline-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #aeb7aa;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}

.engagement-feedback-comment textarea:focus,
.comment-composer textarea:focus,
.comment-inline-form textarea:focus {
  border-color: #72c02c;
  outline: 3px solid rgba(114, 192, 44, 0.2);
}

.engagement-feedback-submit,
.comment-inline-actions,
.comments-more-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.engagement-comments {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.comments-placeholder {
  justify-items: end;
}

.comments-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comments-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.comments-auth-prompt {
  display: grid;
  justify-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 16px;
  text-align: right;
}

.comments-auth-prompt p {
  margin: 0;
}

.comment-composer {
  display: grid;
  gap: 7px;
}

.comment-composer-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  padding: 8px;
}

.comment-composer-input:focus-within {
  border-color: #72c02c;
  box-shadow: 0 0 0 3px rgba(114, 192, 44, 0.14);
}

.comment-composer textarea {
  min-height: 42px;
  max-height: 160px;
  resize: none;
  border: 0;
  padding: 9px 8px;
  outline: 0;
}

.comment-composer textarea:focus {
  border: 0;
  outline: 0;
}

.comments-list {
  display: grid;
  gap: 14px;
}

.comment-item {
  display: grid;
  min-width: 0;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 13px;
}

.comment-item.is-deleted {
  background: var(--surface-soft);
}

.comment-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 2px 9px;
}

.comment-head time {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.76rem;
}

.comment-avatar {
  display: grid;
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  color: #315f18;
  background: var(--accent-soft);
  font-weight: 800;
}

.comment-body {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.55;
}

.comment-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.comment-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  padding: 5px 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.comment-action:hover,
.comment-action:focus-visible,
.comment-action[aria-pressed="true"] {
  color: #315f18;
  background: var(--accent-soft);
  outline: none;
}

.comment-action.is-primary {
  color: #fff;
  background: #72c02c;
}

.comment-action:disabled {
  cursor: wait;
  opacity: 0.55;
}

.comment-reaction-count {
  min-width: 1ch;
}

.comment-delete-action {
  color: #b42318;
}

.comment-inline-form {
  display: grid;
  gap: 8px;
}

.comment-replies {
  display: grid;
  gap: 10px;
  margin-left: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.comment-replies .comment-item {
  border-radius: 10px;
  padding: 11px;
}

.comment-load-replies {
  justify-self: end;
}

@media (min-width: 640px) {
  .engagement-feedback-sheet {
    align-items: center;
    padding: 24px;
  }

  .engagement-feedback-dialog {
    width: min(560px, 100%);
    border-radius: 16px;
    padding: 22px;
  }

  .comment-item {
    padding: 15px;
  }

  .comment-replies {
    margin-left: 30px;
    padding-left: 16px;
  }
}
