*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Color */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-subtle: #f1f5f9;
  --color-text: #0f172a;
  --color-subtitle: #64748b;
  --color-text-primary: var(--color-text);
  --color-text-secondary: var(--color-subtitle);
  --color-text-muted: #64748b;
  --color-primary: #2563eb;
  --color-brand: var(--color-primary);
  --color-accent: var(--color-primary);
  --color-primary-hover: #1d4ed8;
  --color-primary-active: #1e40af;
  --color-primary-light: rgba(37, 99, 235, 0.08);
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-danger: var(--color-error);
  --color-danger-hover: #b91c1c;
  --color-danger-bg: var(--color-error-bg);
  --color-success: #047857;
  --color-success-bg: #ecfdf5;
  --color-warning: #b45309;
  --color-warning-bg: #fffbeb;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  /* Typography */
  --font-size-page-title: clamp(1.75rem, 5vw, 2.25rem);
  --font-size-section-title: clamp(1.5rem, 4vw, 2rem);
  --font-size-card-title: 1.125rem;
  --font-size-body: 1rem;
  --font-size-meta: 0.875rem;
  --font-size-label: 0.8125rem;
  --line-height-tight: 1.3;
  --line-height-body: 1.6;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Shape and elevation */
  --nav-height: 4rem;
  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-md: var(--radius);
  --radius-lg: 1rem;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);

  /* Layout */
  --content-width: 60rem;
  --home-content-width: 75rem;
  --search-content-width: 62.5rem;
  --reading-width: 45rem;
  --form-width: 35rem;
  --page-gutter: 1.5rem;
  --page-gutter-mobile: 1rem;
  --card-gap: var(--space-4);
  --section-gap: var(--space-8);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Minimum design system primitives ── */

.ui-page {
  width: 100%;
  min-height: calc(100vh - var(--nav-height));
  padding: var(--section-gap) var(--page-gutter) calc(var(--section-gap) * 2);
  background: var(--color-bg);
}

.ui-page__content {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
}

.ui-page__header {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--section-gap);
}

.ui-page__title {
  font-size: var(--font-size-page-title);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

.ui-page__intro {
  max-width: var(--reading-width);
  color: var(--color-text-secondary);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}

.ui-section {
  margin-top: var(--section-gap);
}

.ui-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.ui-section-header__title {
  font-size: var(--font-size-section-title);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

.ui-section-header__description {
  margin-top: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--font-size-meta);
  line-height: var(--line-height-body);
}

.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-size: var(--font-size-meta);
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ui-button--primary {
  color: #ffffff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.ui-button--primary:hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.ui-button--secondary {
  color: var(--color-text-primary);
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

.ui-button--secondary:hover:not(:disabled, [aria-disabled="true"]),
.ui-button--ghost:hover:not(:disabled, [aria-disabled="true"]) {
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-color: rgba(37, 99, 235, 0.35);
}

.ui-button--ghost {
  color: var(--color-text-secondary);
  background: transparent;
}

.ui-button--danger {
  color: #ffffff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.ui-button--danger:hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--color-danger-hover);
  border-color: var(--color-danger-hover);
}

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

.ui-button:disabled,
.ui-button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.ui-button[aria-busy="true"] {
  cursor: progress;
}

.ui-button[aria-busy="true"]::before,
.ui-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ui-spin 0.75s linear infinite;
}

.ui-button[aria-busy="true"]::before {
  content: "";
}

.ui-field {
  display: grid;
  gap: var(--space-2);
}

.ui-label {
  color: var(--color-text-primary);
  font-size: var(--font-size-meta);
  font-weight: 600;
}

.ui-input,
.ui-textarea,
.ui-select {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-size: var(--font-size-body);
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ui-input::placeholder,
.ui-textarea::placeholder {
  color: var(--color-text-muted);
}

.ui-textarea {
  min-height: 8.75rem;
  line-height: var(--line-height-body);
  resize: vertical;
}

.ui-input[aria-invalid="true"],
.ui-textarea[aria-invalid="true"],
.ui-select[aria-invalid="true"],
.ui-field--error .ui-input,
.ui-field--error .ui-textarea,
.ui-field--error .ui-select {
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}

.ui-input:disabled,
.ui-textarea:disabled,
.ui-select:disabled {
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
  cursor: not-allowed;
}

.ui-helper,
.ui-error-text {
  font-size: var(--font-size-label);
  line-height: 1.5;
}

.ui-helper {
  color: var(--color-text-secondary);
}

.ui-error-text {
  color: var(--color-danger);
}

.ui-card {
  min-width: 0;
  padding: var(--space-6);
  overflow-wrap: anywhere;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.ui-card--interactive {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ui-card--interactive:hover,
.ui-card--interactive:focus-within {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: var(--shadow-md);
}

.ui-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.75rem;
  padding: var(--space-1) var(--space-3);
  overflow-wrap: anywhere;
  color: var(--color-text-secondary);
  background: var(--color-surface-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-label);
  font-weight: 600;
  line-height: 1.25;
}

.ui-chip--brand {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.ui-chip--success {
  color: var(--color-success);
  background: var(--color-success-bg);
}

.ui-chip--warning {
  color: var(--color-warning);
  background: var(--color-warning-bg);
}

.ui-chip--danger {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

.ui-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  overflow: hidden;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: 50%;
  font-size: var(--font-size-meta);
  font-weight: 700;
}

.ui-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ui-avatar--sm {
  width: 2rem;
  height: 2rem;
  font-size: var(--font-size-label);
}

.ui-avatar--lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: var(--font-size-body);
}

.ui-divider {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--color-border);
}

.ui-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.ui-icon-button:hover:not(:disabled) {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.ui-icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ui-loading,
.ui-empty,
.ui-error-state {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--section-gap) var(--space-6);
  text-align: center;
  overflow-wrap: anywhere;
  border-radius: var(--radius-md);
}

.ui-loading {
  color: var(--color-text-secondary);
}

.ui-empty {
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
}

.ui-error-state {
  color: var(--color-danger);
  background: var(--color-danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.ui-state__title {
  color: var(--color-text-primary);
  font-size: var(--font-size-card-title);
  font-weight: 700;
  line-height: var(--line-height-tight);
}

.ui-state__description {
  max-width: 34rem;
  font-size: var(--font-size-meta);
  line-height: var(--line-height-body);
}

:where(.ui-button, .ui-input, .ui-textarea, .ui-select, .ui-icon-button):focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

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

/* ── Navbar ── */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.navbar__logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.navbar__logo:hover {
  color: var(--color-primary);
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-selector {
  padding: 0.375rem 0.625rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  max-width: 7.5rem;
}

.lang-selector:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.navbar__link {
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-subtitle);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar__link:hover {
  color: var(--color-text);
  background-color: var(--color-primary-light);
}

.navbar__link--active {
  color: var(--color-primary);
}

.navbar__link--login {
  color: var(--color-primary);
  font-weight: 600;
}

.navbar__link--login:hover {
  background-color: var(--color-primary);
  color: #ffffff;
}

.navbar__user {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar__link--logout {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-subtitle);
}

.navbar__link--logout:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

/* ── Hero ── */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32rem;
  padding: 4.5rem 2rem 3.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.08), transparent),
    var(--color-bg);
}

.hero__content {
  text-align: center;
  max-width: 640px;
  animation: fadeIn 0.8s ease-out;
}

.hero__title {
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero__subtitle {
  font-size: clamp(1.125rem, 3vw, 1.375rem);
  font-weight: 400;
  color: var(--color-subtitle);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.hero__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--color-primary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hero__button:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.hero__button:active {
  background-color: var(--color-primary-active);
  transform: scale(0.98);
}

.hero__button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

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

.hero-search {
  width: min(100%, 560px);
  margin: 0 auto 2rem;
}

.hero-search__field,
.search-bar__field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: #ffffff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hero-search__icon,
.search-bar__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-subtitle, #6b7280);
}

.hero-search__input,
.search-bar__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--color-text, #111827);
  outline: none;
}

.hero-search__input::placeholder,
.search-bar__input::placeholder {
  color: var(--color-subtitle, #9ca3af);
}

.hero-search__clear,
.search-bar__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-subtitle, #6b7280);
  cursor: pointer;
}

.hero-search__clear:hover,
.search-bar__clear:hover,
.hero-search__clear:focus-visible,
.search-bar__clear:focus-visible {
  background: rgba(0, 0, 0, 0.05);
  outline: none;
}

.hero-search__submit,
.search-bar__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--color-primary);
  color: #ffffff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.hero-search__submit:hover,
.search-bar__submit:hover {
  background: var(--color-primary-hover);
}

.hero-search__submit:focus-visible,
.search-bar__submit:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Homepage product entries ── */

.product-entries {
  padding: 0 1rem 1.5rem;
}

.product-entries__inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.product-entry {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 1rem;
  background: var(--color-surface, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.product-entry:hover,
.product-entry:focus-visible {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.product-entry--guides {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, #fff 100%);
}

.product-entry__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}

.product-entry__desc {
  margin: 0;
  color: var(--color-subtitle, #6b7280);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.product-entry__badge {
  align-self: flex-start;
}

.search-page,
.guides-page {
  padding: 2rem 1rem 4rem;
}

.search-page__inner,
.guides-page__inner {
  max-width: 760px;
  margin: 0 auto;
}

.search-page__header,
.guides-page__header {
  margin-bottom: 1.5rem;
}

.search-page__heading,
.guides-page__heading {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.search-page__intro,
.guides-page__intro {
  color: var(--color-subtitle, #6b7280);
  line-height: 1.6;
}

.guides-page__filters {
  margin-bottom: 1rem;
}

.guides-page__filter {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.guides-page__filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-subtitle, #6b7280);
}

.guides-page__select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.625rem;
  background: var(--color-surface, #fff);
  font: inherit;
}

.guides-page__status {
  margin: 0 0 1rem;
  color: var(--color-subtitle, #6b7280);
}

.guides-page__status--error {
  color: #b91c1c;
}

.guides-page__count {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--color-subtitle, #6b7280);
}

.guides-page__results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guides-page__footer {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.guides-page__load-more {
  width: 100%;
  max-width: 320px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--color-primary, #2563eb);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.guides-page__load-more:hover,
.guides-page__load-more:focus-visible {
  background: rgba(37, 99, 235, 0.06);
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: 2px;
}

.guides-page__load-more:disabled {
  opacity: 0.6;
  cursor: wait;
}

.guides-page__loading-more,
.guides-page__end {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-subtitle, #6b7280);
  text-align: center;
}

/* ── Category page ── */

.category-page {
  padding: 2rem 1.5rem 4rem;
  background: var(--color-bg);
}

.category-page__inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.category-invalid {
  max-width: 32rem;
  margin: 3rem auto;
  text-align: center;
}

.category-invalid__heading {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.category-invalid__message {
  color: var(--color-subtitle);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.category-invalid__back,
.category-header__back {
  display: inline-flex;
  align-items: center;
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.category-invalid__back:hover,
.category-header__back:hover,
.category-invalid__back:focus-visible,
.category-header__back:focus-visible {
  text-decoration: underline;
  outline: none;
}

.category-header {
  margin-bottom: 2.5rem;
}

.category-header__back {
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.category-header__identity {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.category-header__icon {
  font-size: 2.5rem;
  line-height: 1;
}

.category-header__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.category-header__desc {
  color: var(--color-subtitle);
  line-height: 1.6;
  max-width: 40rem;
}

.category-section {
  margin-bottom: 3rem;
}

.category-section__heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.category-community__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.category-community__sort {
  color: var(--color-subtitle);
  font-size: 0.875rem;
  font-weight: 600;
}

.category-community__filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-community__filter-label {
  color: var(--color-subtitle);
  font-size: 0.8125rem;
  font-weight: 600;
}

.category-community__select {
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
}

.category-community__select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.category-community__count {
  color: var(--color-subtitle);
  font-size: 0.875rem;
  margin-left: auto;
}

.category-section__status {
  margin: 0 0 1rem;
  color: var(--color-subtitle);
}

.category-section__status--error {
  color: var(--color-error);
}

.category-section__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-section__view-all {
  display: inline-block;
  margin-top: 1rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.category-section__view-all:hover,
.category-section__view-all:focus-visible {
  text-decoration: underline;
  outline: none;
}

.category-guide-preview__item {
  display: block;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.category-guide-preview__item:hover,
.category-guide-preview__item:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  outline: none;
}

.search-bar {
  margin-bottom: 1rem;
}

.search-page__filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-page__filter {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.search-page__filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-subtitle, #6b7280);
}

.search-page__select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.5rem;
  background: #ffffff;
  font: inherit;
}

.search-page__hint,
.search-page__status,
.search-page__count {
  margin: 0 0 1rem;
  color: var(--color-subtitle, #6b7280);
}

.search-page__status--error {
  color: #b91c1c;
}

.search-page__count {
  font-weight: 600;
  color: var(--color-text, #111827);
}

.search-page__results {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.search-result {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.75rem;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-result:hover,
.search-result:focus-within {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.search-result--guide {
  border-left: 3px solid var(--color-primary);
}

.search-result__link {
  display: block;
  padding: 1rem 1.125rem;
  color: inherit;
  text-decoration: none;
}

.search-result__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.625rem;
}

.search-result__title {
  flex: 1 1 100%;
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.search-result__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(107, 114, 128, 0.12);
  color: var(--color-subtitle, #4b5563);
  font-size: 0.75rem;
  font-weight: 600;
}

.search-result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.625rem;
  margin-bottom: 0.625rem;
  font-size: 0.8125rem;
  color: var(--color-subtitle, #6b7280);
}

.search-result__tag,
.search-result__lang,
.search-result__updated,
.search-result__verified {
  display: inline-flex;
  align-items: center;
}

.search-result__snippet {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text, #374151);
  word-break: break-word;
}

.search-result__highlight {
  background: rgba(250, 204, 21, 0.35);
  color: inherit;
  padding: 0 0.125rem;
  border-radius: 0.125rem;
}

@media (max-width: 640px) {
  .product-entries__inner {
    grid-template-columns: 1fr;
  }

  .hero-search__field,
  .search-bar__field {
    flex-wrap: wrap;
    padding: 0.625rem;
  }

  .hero-search__input,
  .search-bar__input {
    width: 100%;
    order: 1;
  }

  .hero-search__icon,
  .search-bar__icon {
    order: 0;
  }

  .hero-search__clear,
  .search-bar__clear {
    order: 2;
    margin-left: auto;
  }

  .hero-search__submit,
  .search-bar__submit {
    order: 3;
    width: 100%;
  }

  .search-page__filters {
    grid-template-columns: 1fr;
  }
}

/* ── Categories ── */

.categories {
  padding: 4rem 1.5rem 5rem;
  background: var(--color-bg);
}

.categories__inner {
  max-width: 960px;
  margin: 0 auto;
}

.categories__heading {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 0.75rem;
}

.categories__intro {
  text-align: center;
  color: var(--color-subtitle);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 2.5rem;
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 9.5rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  animation: fadeIn 0.6s ease-out backwards;
}

.category-card:nth-child(1) { animation-delay: 0.05s; }
.category-card:nth-child(2) { animation-delay: 0.1s; }
.category-card:nth-child(3) { animation-delay: 0.15s; }
.category-card:nth-child(4) { animation-delay: 0.2s; }
.category-card:nth-child(5) { animation-delay: 0.25s; }
.category-card:nth-child(6) { animation-delay: 0.3s; }
.category-card:nth-child(7) { animation-delay: 0.35s; }
.category-card:nth-child(8) { animation-delay: 0.4s; }
.category-card:nth-child(9) { animation-delay: 0.45s; }

.category-card:hover,
.category-card:focus-visible {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  outline: none;
}

.category-card--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.category-card--active:hover,
.category-card--active:focus-visible {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.category-card:active {
  transform: translateY(0);
}

.category-card__icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.875rem;
}

.category-card__title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.category-card__desc {
  font-size: 0.875rem;
  color: var(--color-subtitle);
  line-height: 1.55;
}

.categories__toggle {
  display: none;
  margin: 1.5rem auto 0;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: var(--font-size-meta);
  font-weight: 600;
  cursor: pointer;
}

.categories__toggle:hover {
  border-color: var(--color-primary);
}

.categories__toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Posts ── */

.posts {
  padding: 0 1.5rem 5rem;
  background: var(--color-bg);
}

.posts__inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.posts__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.posts__heading-group {
  max-width: 38rem;
  text-align: center;
}

.posts__heading {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.posts__intro {
  margin-top: 0.625rem;
  color: var(--color-subtitle);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.plaza-mode {
  display: inline-flex;
  gap: 0.375rem;
  padding: 0.25rem;
  background: var(--color-surface-subtle);
  border-radius: var(--radius-pill);
}

.plaza-mode__btn {
  padding: 0.4375rem 1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-subtitle);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.plaza-mode__btn:hover {
  color: var(--color-text);
}

.plaza-mode__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.plaza-mode__btn--active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.posts__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.posts__filter {
  padding: 0.5rem 1.125rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-subtitle);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.posts__filter:hover {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.posts__filter--active {
  color: #ffffff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.posts__filter--active:hover {
  color: #ffffff;
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.posts__filter:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.posts__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.posts__loading {
  display: grid;
  gap: 1rem;
}

.posts__loading[hidden] {
  display: none;
}

.post-skeleton {
  min-height: 10rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 20%, rgba(255, 255, 255, 0.72) 50%, transparent 80%) 0 0 / 220% 100%,
    linear-gradient(var(--color-surface-subtle) 0 0) 1.5rem 1.5rem / 36% 1.25rem no-repeat,
    linear-gradient(var(--color-surface-subtle) 0 0) 1.5rem 3.75rem / 72% 0.875rem no-repeat,
    linear-gradient(var(--color-surface-subtle) 0 0) 1.5rem 5.5rem / calc(100% - 3rem) 3rem no-repeat,
    var(--color-surface);
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  to {
    background-position: -220% 0, 1.5rem 1.5rem, 1.5rem 3.75rem, 1.5rem 5.5rem, 0 0;
  }
}

.posts__empty {
  text-align: center;
  color: var(--color-subtitle);
  font-size: 1rem;
  line-height: 1.6;
  padding: 2.5rem 1.5rem;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

.posts__empty-message {
  margin: 0 0 1.25rem;
}

.posts__empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s ease, transform 0.2s ease;
}

.posts__empty-action:hover,
.posts__empty-action:focus-visible {
  background: #1d4ed8;
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.posts__status {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  border-radius: var(--radius);
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-text);
}

.posts__status--error {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}

/* ── Saved posts page ── */

.saved-page {
  padding: 2.5rem 1.5rem 5rem;
  background: var(--color-bg);
  min-height: calc(100vh - 4rem);
}

.saved-page__inner {
  max-width: 960px;
  margin: 0 auto;
}

.saved-page__header {
  text-align: center;
  margin-bottom: 2rem;
}

.saved-page__heading {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.saved-page__intro {
  color: var(--color-subtitle);
  font-size: 0.9375rem;
  max-width: 36rem;
  margin: 0 auto;
}

.saved-page__empty {
  text-align: center;
  color: var(--color-subtitle);
  font-size: 1rem;
  line-height: 1.6;
  padding: 2.5rem 1.5rem;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

.saved-page__login-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2.5rem 1rem;
}

.saved-page__login-prompt[hidden] {
  display: none !important;
}

.saved-page__login-message {
  color: var(--color-subtitle);
  font-size: 0.9375rem;
  margin: 0;
}

.saved-page__login-link {
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.saved-page__login-link:hover {
  text-decoration: underline;
}

.saved-page__status {
  text-align: center;
  color: var(--color-subtitle);
  font-size: 0.9375rem;
  padding: 2rem 1rem;
}

.saved-page__status[hidden] {
  display: none !important;
}

.my-posts-feedback {
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
}

.my-posts-feedback[hidden] {
  display: none !important;
}

.my-posts-feedback--success {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.my-posts-feedback--error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.saved-page__empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 1rem 0 2rem;
}

.saved-page__empty-state[hidden] {
  display: none !important;
}

.saved-page__empty-state .saved-page__empty {
  margin: 0;
}

.saved-page__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.saved-page__action:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.saved-page__action:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.profile-hub {
  min-height: calc(100vh - 72px);
  padding: 48px 20px 72px;
  background: var(--color-bg, #f7f8fa);
}

.profile-hub__inner {
  width: min(760px, 100%);
  margin: 0 auto;
}

.profile-hub__header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.profile-hub__header p,
.profile-hub__status {
  margin: 0;
  color: #5c6677;
}

.profile-hub__status {
  padding: 32px 0;
}

.profile-hub__status--error {
  color: #b42318;
}

.profile-hub__summary {
  margin-top: 28px;
}

.profile-hub__summary[hidden],
.profile-hub__status[hidden] {
  display: none;
}

.profile-hub__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.profile-hub__facts div,
.profile-hub__shortcut {
  padding: 20px;
  border: 1px solid #e1e5ea;
  border-radius: 14px;
  background: #fff;
}

.profile-hub__facts dt {
  margin-bottom: 8px;
  color: #667085;
  font-size: 0.82rem;
  font-weight: 600;
}

.profile-hub__facts dd {
  margin: 0;
  color: #17202a;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.profile-hub__shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.profile-hub__shortcut {
  display: grid;
  gap: 7px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.profile-hub__shortcut span {
  color: #667085;
  line-height: 1.45;
}

.profile-hub__shortcut:hover {
  border-color: #0f766e;
  transform: translateY(-1px);
}

.profile-hub__signout {
  margin-top: 22px;
  padding: 11px 18px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 640px) {
  .profile-hub__facts,
  .profile-hub__shortcuts {
    grid-template-columns: 1fr;
  }

  .profile-hub {
    padding-top: 32px;
  }
}

.my-klw-page .klw-global-create {
  display: none;
}

.my-klw {
  min-height: calc(100vh - 72px);
  padding: 28px 16px 88px;
  background: var(--color-bg, #f7f8fa);
}

.my-klw__inner {
  width: min(640px, 100%);
  margin: 0 auto;
}

.my-klw__header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
}

.my-klw__header p,
.my-klw__hint,
.my-klw__status {
  margin: 0;
  color: #5c6677;
  line-height: 1.5;
}

.my-klw__status {
  padding: 24px 0;
}

.my-klw__status--error {
  color: #b42318;
}

.my-klw__card,
.my-klw__section {
  margin-top: 16px;
  padding: 18px 16px;
  border: 1px solid #e1e5ea;
  border-radius: 14px;
  background: #fff;
}

.my-klw__section-title {
  margin: 0;
  font-size: 1.05rem;
}

.my-klw__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.my-klw__section-link {
  color: #0f766e;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.my-klw__facts {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
}

.my-klw__facts--compact {
  margin-top: 10px;
}

.my-klw__facts dt {
  margin-bottom: 4px;
  color: #667085;
  font-size: 0.8rem;
  font-weight: 600;
}

.my-klw__facts dd {
  margin: 0;
  color: #17202a;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.my-klw__readonly {
  user-select: text;
}

.my-klw__count {
  margin: 8px 0 0;
  color: #344054;
  font-weight: 600;
}

.my-klw__preview {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.my-klw__preview li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eef0f3;
}

.my-klw__preview-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.my-klw__preview-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 0.75rem;
  font-weight: 600;
}

.my-klw__empty {
  margin: 8px 0 0;
  color: #667085;
}

.my-klw__retry {
  margin-left: 8px;
  padding: 4px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.my-klw__language-current {
  margin: 10px 0 0;
  color: #344054;
}

.my-klw__logout-wrap {
  margin-top: 20px;
}

.my-klw__logout {
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.my-klw__logout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.my-klw [hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .my-klw {
    padding-top: 20px;
    padding-bottom: 96px;
  }
}

.post-card {
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.post-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-card__link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.post-card__media {
  margin: 0 0 var(--space-3);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}

.post-card__media-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 12rem;
  object-fit: cover;
}

.post-card--link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-card:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: var(--shadow-md);
}

.post-card__header {
  margin-bottom: 0.875rem;
}

.post-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 0.625rem;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.post-card__tag {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: 999px;
}

.post-card__type {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #075985;
  background: #e0f2fe;
  border-radius: var(--radius-pill);
}

.post-card__lang {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #4338ca;
  background: rgba(67, 56, 202, 0.08);
  border-radius: 999px;
}

.post-card__region {
  font-size: 0.8125rem;
  color: var(--color-subtitle);
}

.post-card__region::before {
  content: "📍 ";
}

.post-card__content {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.65;
  margin-bottom: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-subtitle);
}

.post-card__anonymous {
  font-weight: 500;
}

.post-card__footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-card__comment-count {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-subtitle);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card__comment-count:hover {
  color: var(--color-primary);
}

.post-card__comment-count:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.post-card__bookmark-btn {
  padding: 0.25rem 0.625rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-subtitle);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.post-card__bookmark-btn:hover:not(:disabled) {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.post-card__bookmark-btn--active {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--color-primary-light);
}

.post-card__bookmark-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-card__bookmark-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.post-card__delete-btn {
  padding: 0.25rem 0.625rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.post-card__delete-btn:hover:not(:disabled) {
  color: #991b1b;
  border-color: #f87171;
  background: #fee2e2;
}

.post-card__delete-btn:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

.post-card__delete-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.post-card__translate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.post-card__translate-btn {
  padding: 0.375rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-subtitle);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.post-card__translate-btn:hover:not(:disabled) {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.post-card__translate-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.post-card__translate-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-card__translate-status {
  font-size: 0.8125rem;
  color: var(--color-error);
}

/* ── Post Detail ── */

.post-detail-page {
  padding: 2.5rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(37, 99, 235, 0.06), transparent),
    var(--color-bg);
  min-height: calc(100vh - var(--nav-height));
}

.post-detail-page__inner {
  max-width: 720px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

.post-detail {
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.post-detail__back {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.post-detail__back:hover {
  text-decoration: underline;
}

.post-detail__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.post-detail__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 0;
  flex: 1 1 12rem;
}

.post-detail__bookmark-btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-subtitle);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.post-detail__bookmark-btn:hover:not(:disabled) {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.post-detail__bookmark-btn--active {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--color-primary-light);
}

.post-detail__bookmark-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-detail__bookmark-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.post-detail__bookmark-btn[hidden] {
  display: none;
}

.post-detail__meta {
  margin-bottom: 0.25rem;
}

.post-detail__translate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0.25rem;
}

.post-detail__translate-btn {
  padding: 0.5rem 1.125rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.post-detail__translate-btn:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.post-detail__translate-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.post-detail__translate-btn[hidden] {
  display: none;
}

.post-detail__translate-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-detail__translate-btn--secondary {
  color: var(--color-subtitle);
  background: var(--color-surface);
  border-color: var(--color-border);
}

.post-detail__translate-btn--secondary:hover:not(:disabled) {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.post-detail__translate-status {
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-subtitle);
}

.post-detail__translate-status--error {
  color: var(--color-error);
}

.post-detail__content {
  font-size: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.post-media {
  min-width: 0;
  margin: 1.25rem 0;
}

.post-media[hidden],
.post-media__grid[hidden],
.post-media__retry[hidden],
.post-media__status[hidden] {
  display: none !important;
}

.post-media__heading {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.post-media__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
}

.post-media__grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.post-media__item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
}

.post-media__image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.post-media__status {
  margin: 0;
  color: var(--color-subtitle);
  font-size: 0.875rem;
}

.post-media__retry {
  min-height: 2.75rem;
  margin-top: 0.75rem;
  padding: 0.625rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: 0.5rem;
  cursor: pointer;
}

.post-media__retry:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .post-media__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.post-detail__footer {
  margin-top: 0.5rem;
}

.post-detail__report {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.post-detail__report-btn {
  margin-top: 0.25rem;
}

.post-detail__report-status {
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
}

.post-detail__report-status--success {
  color: var(--color-success, #15803d);
}

.post-detail__report-status--error {
  color: var(--color-error);
}

/* ── Post supplements ── */

.post-supplements {
  margin-top: 1.5rem;
  padding: 1.5rem 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.post-supplements[hidden] {
  display: none !important;
}

.post-supplements__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.post-supplements__heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.post-supplements__heading[hidden] {
  display: none !important;
}

.post-supplements__add-btn {
  padding: 0.4375rem 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.post-supplements__add-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.4);
}

.post-supplements__add-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-supplements__add-btn[hidden] {
  display: none !important;
}

.post-supplements__status {
  font-size: 0.875rem;
  margin: 0 0 1rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
}

.post-supplements__status[hidden] {
  display: none !important;
}

.post-supplements__status--error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.post-supplements__status--success {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.post-supplements__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-supplements__list:empty {
  display: none;
}

.post-supplements__item {
  padding: 1rem 1.125rem;
  background: rgba(37, 99, 235, 0.04);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-left: 3px solid var(--color-primary);
  border-radius: 0.625rem;
}

.post-supplements__item-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 0.375rem;
}

.post-supplements__item-meta {
  font-size: 0.8125rem;
  color: var(--color-subtitle);
  margin: 0 0 0.625rem;
}

.post-supplements__item-content {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.post-supplements__content-block {
  margin-top: 0.75rem;
}

.post-supplements__content-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-subtitle);
  margin: 0 0 0.35rem;
}

.post-supplements__translation {
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border);
}

.post-supplements__translation[hidden] {
  display: none !important;
}

.post-supplements__item-translation {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.post-supplements__translate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.post-supplements__translate-btn {
  padding: 0.375rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-subtitle);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.post-supplements__translate-btn:hover:not(:disabled) {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.post-supplements__translate-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.post-supplements__translate-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-supplements__translate-status {
  font-size: 0.8125rem;
  color: var(--color-subtitle);
}

.post-supplements__translate-status--error {
  color: var(--color-error);
}

.post-supplements__form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.post-supplements__form[hidden] {
  display: none !important;
}

.post-supplements__label {
  display: block;
  margin-bottom: 0.5rem;
}

.post-supplements__textarea {
  min-height: 6rem;
}

.post-supplements__form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.875rem;
}

.post-supplements__cancel-btn {
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-subtitle);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  cursor: pointer;
}

.post-supplements__cancel-btn:hover:not(:disabled) {
  color: var(--color-text);
  border-color: var(--color-subtitle);
}

.post-supplements__cancel-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-supplements__submit {
  min-width: 7rem;
}

.post-detail__loading {
  padding: 2.5rem 2rem;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.post-detail__loading-text {
  color: var(--color-subtitle);
  font-size: 1rem;
}

.post-detail__not-found {
  padding: 2.5rem 2rem;
  text-align: center;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}

.post-detail__not-found-title {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.post-detail__not-found-intro {
  color: var(--color-subtitle);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ── Comments ── */

.comments {
  margin-top: 1.5rem;
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.comments__heading {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.comments__status {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--color-subtitle);
}

.comments__status--error {
  color: var(--color-error);
}

.comments__status--success {
  color: #15803d;
}

.comments__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comments__item {
  padding: 1rem 1.125rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) - 2px);
}

.comments__item-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.comments__item-header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.comments__delete-btn {
  padding: 0.25rem 0.625rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-subtitle);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.comments__edit-btn,
.comments__edit-cancel {
  padding: 0.25rem 0.625rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-subtitle);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.comments__edit-btn:hover,
.comments__edit-cancel:hover {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.comments__edit-btn:focus-visible,
.comments__edit-cancel:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.comments__edited {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-subtitle);
}

.comments__edit-form {
  margin-top: 0.25rem;
}

.comments__edit-textarea {
  min-height: 4.5rem;
  margin-bottom: 0.5rem;
}

.comments__edit-error {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.comments__edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comments__edit-save {
  min-width: 5.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.comments__delete-btn:hover {
  color: var(--color-error);
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}

.comments__delete-btn:focus-visible {
  outline: 2px solid var(--color-error);
  outline-offset: 2px;
}

.comments__delete-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.comments__author {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.comments__time {
  font-size: 0.8125rem;
}

.comments__body {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.comments__item-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.625rem;
}

.comments__report-btn,
.comments__report-cancel {
  padding: 0.25rem 0.625rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-subtitle);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.comments__report-btn:hover,
.comments__report-cancel:hover {
  color: var(--color-error);
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}

.comments__report-btn:focus-visible,
.comments__report-cancel:focus-visible {
  outline: 2px solid var(--color-error);
  outline-offset: 2px;
}

.comments__report-form {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) - 2px);
}

.comments__report-label {
  margin-top: 0.25rem;
  margin-bottom: 0.375rem;
}

.comments__report-select {
  width: 100%;
  margin-bottom: 0.5rem;
}

.comments__report-details {
  min-height: 3.5rem;
  margin-bottom: 0.5rem;
}

.comments__report-error {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.comments__report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comments__report-submit {
  min-width: 7rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.comments__like-btn {
  padding: 0.25rem 0.625rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-subtitle);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.comments__like-btn:hover:not(:disabled) {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.comments__like-btn--active {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.comments__like-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.comments__like-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.comments__like-count {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-subtitle);
  min-width: 1ch;
}

.comments__thread {
  display: flex;
  flex-direction: column;
}

.comments__replies {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-left: 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--color-border);
}

.comments__item--reply {
  padding: 0.875rem 1rem;
  background: var(--color-surface);
}

.comments__reply-actions {
  margin-top: 0.625rem;
}

.comments__reply-btn,
.comments__reply-cancel {
  padding: 0.375rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-subtitle);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.comments__reply-btn:hover,
.comments__reply-cancel:hover {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.35);
  background: var(--color-primary-light);
}

.comments__reply-btn:focus-visible,
.comments__reply-cancel:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.comments__reply-form {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) - 2px);
}

.comments__reply-form[hidden] {
  display: none !important;
}

.comments__reply-textarea {
  min-height: 4rem;
  margin-bottom: 0.5rem;
}

.comments__reply-error {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.comments__reply-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.comments__reply-anonymous {
  margin: 0;
}

.comments__reply-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comments__reply-submit {
  min-width: 7rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.comments__empty {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--color-subtitle);
}

.comments__composer {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
}

.comments__form[hidden],
.comments__login-prompt[hidden] {
  display: none !important;
}

.comments__label {
  margin-bottom: 0.5rem;
}

.comments__textarea {
  min-height: 5.5rem;
  margin-bottom: 0.5rem;
}

.comments__form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
}

.comments__anonymous {
  margin: 0;
}

.comments__submit {
  min-width: 8.5rem;
}

.comments__login-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.comments__login-message {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-subtitle);
}

.comments__login-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.comments__login-link:hover {
  text-decoration: underline;
}

.comments__login-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Create Post Form ── */

.form-page {
  padding: 2.5rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(37, 99, 235, 0.06), transparent),
    var(--color-bg);
  min-height: calc(100vh - var(--nav-height));
}

.form-page__inner {
  max-width: 560px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

.form-page__title {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.form-page__intro {
  color: var(--color-subtitle);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.post-form {
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.post-form--frozen .form-input:disabled,
.post-form--frozen .form-select:disabled,
.post-form--frozen .form-textarea:disabled,
.post-form--frozen .form-checkbox input:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group--checkbox {
  margin-bottom: 1.75rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-input--error,
.form-select--error,
.form-textarea--error {
  border-color: var(--color-error);
  background: var(--color-error-bg);
}

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

.form-error {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--color-error);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
}

.form-checkbox input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-checkbox__label {
  font-size: 0.9375rem;
  color: var(--color-text);
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.875rem;
}

.form-submit {
  padding: 0.875rem 2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--color-primary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-submit:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.form-submit:active:not(:disabled) {
  background-color: var(--color-primary-active);
  transform: scale(0.98);
}

.form-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-submit:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.form-back {
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-subtitle);
  text-decoration: none;
  padding: 0.5rem;
  transition: color 0.2s ease;
}

.form-back:hover {
  color: var(--color-primary);
}

.form-back--button {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
}

.create-media__picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

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

.create-media__select-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.625rem 1.125rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  cursor: pointer;
}

.create-media__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.875rem;
}

.create-media-item {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  grid-template-areas:
    "thumb body"
    "thumb actions";
  gap: 0.5rem 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-bg);
  max-width: 100%;
}

.create-media-item__thumb {
  grid-area: thumb;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.create-media-item__body {
  grid-area: body;
  min-width: 0;
}

.create-media-item__name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  word-break: break-word;
}

.create-media-item__status {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-subtitle);
  word-break: break-word;
}

.create-media-item__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.create-media-item__btn {
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

.create-media-item__btn--secondary {
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.create-media-item__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-forgot {
  margin: -0.25rem 0 0;
  text-align: right;
}

.form-forgot__link {
  padding: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-forgot__link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.form-forgot__link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.success-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  z-index: 200;
  animation: fadeIn 0.3s ease-out;
}

/* ── Auth Page ── */

.auth-page {
  padding: 2.5rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(37, 99, 235, 0.06), transparent),
    var(--color-bg);
  min-height: calc(100vh - var(--nav-height));
}

.auth-page__inner {
  max-width: 480px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.625rem;
}

.auth-tabs__btn {
  flex: 1;
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-subtitle);
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.auth-tabs__btn--active {
  color: #ffffff;
  background: var(--color-primary);
}

.auth-tabs__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.auth-panel {
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.auth-panel__title {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.auth-panel__intro {
  color: var(--color-subtitle);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.auth-form .form-actions {
  margin-top: 0.5rem;
}

.password-field {
  position: relative;
}

.password-field__input {
  padding-right: 2.75rem;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.625rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--color-subtitle);
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.password-field__toggle:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.password-field__toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.password-field__icon {
  display: block;
}

.password-field__icon.is-hidden {
  display: none !important;
}

.form-error--general {
  margin-bottom: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--color-error-bg);
  border-radius: 0.5rem;
}

.auth-success {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 0.5rem;
}

.auth-config-notice {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
  line-height: 1.55;
}

/* ── Animations ── */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Official guide content ── */

.guide-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.post-card--guide,
.guide-card {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.03) 0%, var(--color-surface, #fff) 100%);
}

.post-card--guide .post-card__header,
.guide-card__header {
  gap: 0.5rem;
}

.guide-card__link {
  display: block;
  padding: 1.125rem 1.25rem;
  text-decoration: none;
  color: inherit;
}

.guide-card__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.guide-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.guide-card__summary {
  margin: 0.75rem 0 0;
  color: var(--color-subtitle, #6b7280);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.guide-card__official-source,
.guide-card__verified {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-subtitle, #6b7280);
  line-height: 1.45;
}

.post-card__summary {
  margin: 0.5rem 0 0;
  color: var(--color-subtitle);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Rendered official guide Markdown (detail + feed cards) */
.post-card__content.guide-markdown,
.post-detail__content.guide-markdown {
  white-space: normal;
}

.guide-markdown > :first-child {
  margin-top: 0;
}

.guide-markdown > :last-child {
  margin-bottom: 0;
}

.guide-markdown h1,
.guide-markdown h2,
.guide-markdown h3 {
  color: var(--color-text);
  line-height: 1.35;
  margin: 1.5rem 0 0.75rem;
  font-weight: 700;
}

.guide-markdown h1 {
  font-size: 1.375rem;
}

.guide-markdown h2 {
  font-size: 1.2rem;
}

.guide-markdown h3 {
  font-size: 1.0625rem;
}

.guide-markdown p {
  margin: 0 0 1rem;
}

.guide-markdown ul,
.guide-markdown ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.guide-markdown li + li {
  margin-top: 0.35rem;
}

.guide-markdown li > ul,
.guide-markdown li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.guide-markdown blockquote {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.05);
  color: var(--color-subtitle);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.guide-markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
  word-break: break-word;
}

.guide-markdown pre {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.06);
  line-height: 1.55;
}

.guide-markdown pre code {
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
}

.guide-markdown a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.guide-markdown a:hover {
  color: #1d4ed8;
}

.guide-markdown hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

.guide-markdown-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1rem;
  max-width: 100%;
}

.guide-markdown table {
  width: 100%;
  min-width: 28rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.guide-markdown th,
.guide-markdown td {
  border: 1px solid var(--color-border);
  padding: 0.625rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.guide-markdown th {
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

.guide-markdown tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.02);
}

.guide-markdown strong {
  font-weight: 700;
}

.guide-markdown em {
  font-style: italic;
}

.post-card__guide-admin-btn {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.8125rem;
  cursor: pointer;
}

.post-card__guide-admin-btn--danger {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}

.post-detail__title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.post-detail__guide-badge {
  margin-bottom: 0.125rem;
}

.post-detail__updated {
  margin: 0.25rem 0 0.75rem;
  color: var(--color-subtitle);
  font-size: 0.875rem;
}

.post-detail__admin {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0 0 1rem;
}

.post-detail__admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.post-detail__admin-btn--danger {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}

.form-hint {
  margin: 0.375rem 0 0;
  color: var(--color-subtitle);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* ── Responsive ── */

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

@media (max-width: 768px) {
  html,
  body {
    overflow-x: clip;
    max-width: 100%;
  }

  .navbar {
    padding: 0 1rem;
    height: auto;
    min-height: var(--nav-height);
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    max-width: 100%;
    overflow-x: clip;
  }

  .navbar__actions {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: space-between;
    overflow: hidden;
  }

  .navbar__links {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .navbar__link,
  .navbar__user,
  .navbar__link--logout {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #navAuthSlot {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
  }

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

  .navbar__logo {
    font-size: 1rem;
  }

  .navbar__link {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
  }

  .lang-selector {
    font-size: 0.75rem;
    max-width: 6.5rem;
  }

  .navbar__user {
    max-width: 5.5rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
  }

  .auth-page {
    padding: 2rem 1rem 3rem;
  }

  .auth-panel {
    padding: 1.5rem;
  }

  .hero {
    min-height: auto;
    padding: 3rem 1.5rem;
  }

  .categories {
    padding: 3rem 1rem 4rem;
  }

  .categories__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .categories__grid .category-card {
    min-height: auto;
    padding: 1rem;
  }

  .categories__grid .category-card__icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .categories__grid .category-card__title {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
  }

  .categories__grid .category-card__desc {
    font-size: 0.8125rem;
    line-height: 1.4;
  }

  .categories__grid--collapsed .category-card--secondary {
    display: none;
  }

  .categories__toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .posts {
    padding: 0 1rem 4rem;
  }

  .post-card {
    padding: 1.25rem;
  }

  .post-card__title {
    font-size: 1.0625rem;
  }

  .post-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-page {
    padding: 2rem 1rem 3rem;
  }

  .post-form {
    padding: 1.5rem;
  }

  .ui-page {
    padding: var(--space-6) var(--page-gutter-mobile) var(--section-gap);
  }

  .ui-card {
    padding: var(--space-5);
  }

  .ui-section-header {
    flex-direction: column;
  }
}

/* ── Home Web V1 desktop composition ── */

@media (min-width: 1025px) {
  .home-hero-band {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: center;
    gap: var(--space-8);
    max-width: var(--home-content-width);
    margin: 0 auto;
    padding: 4rem var(--page-gutter) 3.5rem;
    background:
      radial-gradient(ellipse 80% 60% at 30% -10%, rgba(37, 99, 235, 0.08), transparent),
      var(--color-bg);
  }

  .home-hero-band .hero {
    display: block;
    min-height: 0;
    padding: 0;
    background: none;
  }

  .home-hero-band .hero__content {
    max-width: none;
    text-align: left;
  }

  .home-hero-band .hero-search {
    margin: 0 0 2rem;
  }

  .home-hero-band .product-entries {
    padding: 0;
  }

  .home-hero-band .product-entries__inner {
    max-width: none;
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .categories__inner {
    max-width: var(--home-content-width);
  }

  .posts__inner {
    max-width: var(--home-content-width);
  }

  .posts__header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    text-align: left;
  }

  .posts__heading-group {
    text-align: left;
  }

  .posts__heading {
    text-align: left;
  }

  .posts__filters {
    justify-content: flex-end;
  }
}

/* ── Search Web V1 desktop composition ── */

@media (min-width: 1025px) {
  .search-page {
    padding: 3rem var(--page-gutter) 4.5rem;
  }

  .search-page__inner {
    max-width: var(--search-content-width);
  }

  .search-page__header {
    margin-bottom: 2rem;
  }

  .search-page__heading {
    font-size: 2.25rem;
  }

  .search-page .search-bar {
    margin-bottom: 1.5rem;
  }

  .search-page .search-bar__field {
    padding: 0.5rem 0.5rem 0.5rem 1.125rem;
    border-radius: 0.875rem;
  }

  .search-page .search-bar__input {
    font-size: 1.0625rem;
  }

  .search-page .search-bar__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
  }

  .search-page .search-bar__submit {
    padding: 0 1.5rem;
    min-height: 2.75rem;
  }

  .search-page__filters {
    grid-template-columns: max-content max-content;
    justify-content: start;
    align-items: end;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .search-page__filter {
    min-width: 14rem;
  }

  .search-page__hint,
  .search-page__status,
  .search-page__count {
    margin-bottom: 1.25rem;
  }

  .search-page__hint,
  .search-page__status--empty {
    padding: 0.75rem 1rem;
    background: var(--color-surface-subtle);
    border-radius: var(--radius-sm);
  }

  .search-page__status--loading {
    padding: 0.75rem 1rem;
    color: var(--color-primary);
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
  }

  .search-page__status--error {
    padding: 0.75rem 1rem;
    background: var(--color-error-bg);
    border-radius: var(--radius-sm);
  }

  .search-page__results {
    gap: 1rem;
  }

  .search-result__link {
    padding: 1.5rem 1.75rem;
  }

  .search-result__title {
    font-size: 1.25rem;
  }

  .search-result__snippet {
    font-size: 1rem;
  }
}

/* ── Category Web V1 desktop composition ── */

@media (min-width: 1025px) {
  .category-page {
    padding: 3rem var(--page-gutter) 4.5rem;
  }

  .category-page__inner {
    max-width: var(--home-content-width);
  }

  .category-header__icon {
    font-size: 3rem;
  }

  .category-section {
    margin-bottom: 3.5rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* App language loading (reduce flicker) */
.app-lang-loading .navbar,
.app-lang-loading main {
  visibility: hidden;
}

/* Onboarding */
.onboarding-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg, #fafafa);
}

.onboarding {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.onboarding__card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.onboarding__step-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #666);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.onboarding__title {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.onboarding__intro {
  color: var(--color-text-muted, #666);
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.onboarding__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.onboarding__panel[hidden] {
  display: none !important;
}

.onboarding__label {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.onboarding__select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 8px;
  background: #fff;
  min-height: 44px;
}

.onboarding__hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #666);
  margin: 0.5rem 0 0;
  line-height: 1.45;
}

.onboarding__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.onboarding__primary,
.onboarding__secondary {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.onboarding__primary {
  background: var(--color-accent, #2563eb);
  color: #fff;
  border: none;
}

.onboarding__primary:disabled,
.onboarding__secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.onboarding__secondary {
  background: #fff;
  border: 1px solid var(--color-border, #ddd);
  color: inherit;
}

.onboarding__secondary[hidden] {
  display: none !important;
}

.onboarding__error {
  color: #c0392b;
  font-size: 0.875rem;
  margin: 0;
}

.onboarding__error[hidden] {
  display: none !important;
}

/* Official guide locale fallback notice */
.guide-fallback-notice {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #666);
  background: #f5f5f5;
  border-left: 3px solid var(--color-accent, #2563eb);
  padding: 0.625rem 0.875rem;
  margin: 0 0 1rem;
  border-radius: 0 6px 6px 0;
  line-height: 1.45;
}

@media (max-width: 480px) {
  .onboarding__card {
    padding: 1.5rem 1.25rem;
  }

  .onboarding__title {
    font-size: 1.25rem;
  }
}

/* Minimal admin-only report review. Evidence is always rendered as text. */
.moderation__layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.moderation__queue-wrap,
.moderation__queue,
.moderation__detail {
  min-width: 0;
}

.moderation__queue,
.moderation__detail {
  border: 1px solid var(--color-border, #ddd);
  border-radius: 10px;
  background: #fff;
  padding: 1rem;
}

.moderation__item + .moderation__item {
  border-top: 1px solid var(--color-border, #ddd);
}

.moderation__item {
  padding: 0.75rem 0;
  display: grid;
  gap: 0.35rem;
}

.moderation__item p,
.moderation__detail p {
  overflow-wrap: anywhere;
}

.moderation__item button,
.moderation__more,
.moderation__actions button {
  justify-self: start;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 6px;
  background: #f8fafc;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.moderation__more {
  margin-top: 0.5rem;
}

.moderation__item button:disabled,
.moderation__actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.moderation__metadata {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem 1rem;
}

.moderation__metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.moderation__snapshot {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.75rem;
  border-radius: 6px;
  background: #f8fafc;
}

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

.moderation__hold {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--color-border, #ddd);
  padding-top: 1rem;
}

.moderation__hold input {
  max-width: 28rem;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 6px;
  padding: 0.5rem;
}

@media (max-width: 760px) {
  .moderation__layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Unit I: Create flow + global create entry ── */

body.create-page {
  padding-bottom: 0;
}

body.create-page .klw-global-create {
  display: none;
}

.form-page__inner {
  max-width: 680px;
}

.create-type-step {
  margin-bottom: 1.5rem;
}

.create-type-step__heading {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.create-type-step__intro {
  color: var(--color-subtitle);
  margin-bottom: 1rem;
}

.create-type-step__choices {
  display: grid;
  gap: 0.75rem;
}

.create-type-card {
  text-align: left;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
}

.create-type-card__title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.create-type-card__desc {
  display: block;
  color: var(--color-subtitle);
  font-size: 0.9375rem;
}

.create-type-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.create-type-summary__change {
  border: 0;
  background: none;
  color: var(--color-primary);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.create-draft-banner {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.create-draft-banner__note {
  font-size: 0.875rem;
  color: var(--color-subtitle);
  margin: 0.35rem 0 0.75rem;
}

.create-draft-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.create-sensitive-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.create-sensitive-dialog[hidden] {
  display: none;
}

.create-sensitive-dialog__panel {
  width: min(100%, 28rem);
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.create-sensitive-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.klw-global-create {
  display: none;
}

@media (max-width: 768px) {
  body:not(.create-page) {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  .klw-global-create {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    padding: 0.35rem 0.75rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  }

  .klw-global-create__inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    align-items: end;
    max-width: 28rem;
    margin: 0 auto;
  }

  .klw-global-create__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 2.75rem;
    font-size: 0.6875rem;
    color: var(--color-subtitle);
    text-decoration: none;
    text-align: center;
  }

  .klw-global-create__item--primary {
    position: relative;
    top: -0.65rem;
  }

  .klw-global-create__plus {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    box-shadow: var(--shadow-md);
  }

  .klw-global-create__item-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
  }

  .klw-global-create__badge {
    position: absolute;
    top: 0;
    right: 0.15rem;
    min-width: 1.1rem;
    max-width: 2rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: var(--color-danger, #dc2626);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.notifications-page .klw-global-create {
  display: block;
}

.notifications {
  padding: 1rem 1rem 5rem;
  max-width: 28rem;
  margin: 0 auto;
}

.notifications__inner {
  width: 100%;
}

.notifications__header h1 {
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
}

.notifications__tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.notifications__tab {
  flex: 1;
  min-height: 2.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-surface);
  font: inherit;
  cursor: pointer;
}

.notifications__tab--active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

.notifications__status {
  margin: 0.5rem 0;
  color: var(--color-subtitle);
}

.notifications__status--error {
  color: var(--color-danger, #dc2626);
}

.notifications__retry {
  margin-left: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
}

.notifications__empty {
  margin: 1rem 0;
  color: var(--color-subtitle);
}

.notifications__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notifications__item {
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 0.65rem;
  background: var(--color-surface);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.notifications__item--unread {
  border-left: 3px solid var(--color-primary);
}

.notifications__message {
  margin: 0 0 0.35rem;
  font-weight: 500;
}

.notifications__meta {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-subtitle);
}

.notifications__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.notifications__open,
.notifications__mark-read {
  min-height: 2.75rem;
  padding: 0 0.85rem;
  font: inherit;
}

.notifications__mark-read {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
}

.notifications__unavailable,
.notifications__no-target {
  font-size: 0.8125rem;
  color: var(--color-subtitle);
}

@media (max-width: 390px) {
  .notifications {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .notifications__item {
    padding: 0.75rem;
  }
}

/* ── PM-02 Web Homepage Shell ──
   Scoped to .home-page / .navbar--home so other pages keep their current
   header and layout. Desktop composition first; mobile gets a safe stacked
   fallback and is validated in its own pass. */

.navbar--home .navbar__actions {
  flex: 1;
  min-width: 0;
  margin-left: 2.5rem;
}

.navbar--home .navbar__links {
  flex: 1;
  min-width: 0;
}

.navbar__spacer {
  flex: 1;
}

.navbar__bell {
  position: relative;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.25rem;
  border: 1px solid var(--color-border);
  border-radius: 0.625rem;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.navbar__bell[hidden] {
  display: none;
}

.navbar__bell:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.navbar__bell:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.navbar__bell-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.3rem;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  background: var(--color-error);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.125rem;
  text-align: center;
}

.navbar__bell-badge[hidden] {
  display: none;
}

.home-subnav {
  position: relative;
  z-index: 90;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.home-subnav__inner {
  max-width: var(--home-content-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.875rem;
}

.home-subnav__menu {
  position: relative;
}

.home-subnav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
}

.home-subnav__trigger::-webkit-details-marker {
  display: none;
}

.home-subnav__trigger:focus-visible {
  outline: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--focus-ring);
}

.home-subnav__menu[open] .home-subnav__trigger svg {
  transform: rotate(180deg);
}

.home-subnav__panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 14rem;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.home-subnav__panel a {
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
}

.home-subnav__panel a:hover,
.home-subnav__panel a:focus-visible {
  outline: none;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Hero: search + Discover */
.home-hero {
  padding: 1.75rem var(--page-gutter) 1.5rem;
}

.home-hero__inner {
  max-width: var(--home-content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.home-hero__search {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  min-width: 0;
}

.home-hero__eyebrow {
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  font-weight: 600;
  color: var(--color-primary);
}

.home-hero__title {
  font-size: clamp(1.875rem, 2.6vw, 2.375rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.home-hero .hero-search {
  width: 100%;
  margin: 0.25rem 0 0;
}

.home-popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.home-popular__label {
  margin-right: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-subtitle);
}

.home-popular__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.home-popular__chip {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.home-popular__chip:hover,
.home-popular__chip:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.home-discover {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 1.125rem 1.25rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  background: #eef0ff;
  border: 1px solid #dadefc;
  border-radius: 1.25rem;
  color: #1e1b4b;
}

.home-discover__blob {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.home-discover__blob--one {
  top: -4.5rem;
  right: -3.5rem;
  width: 10.5rem;
  height: 10.5rem;
  background: #e0e3ff;
}

.home-discover__blob--two {
  top: 0.75rem;
  right: 11rem;
  width: 2.75rem;
  height: 2.75rem;
  background: #fbe3ee;
}

.home-discover__head {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.home-discover__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1e1b4b;
}

.home-discover__intro {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #4c5185;
}

.home-discover__list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.home-discover__topic {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3125rem 0.75rem 0.3125rem 0.375rem;
  border: 1px solid #e3e6fb;
  border-radius: 0.875rem;
  background: #ffffff;
  color: #1e1b4b;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-discover__topic:hover,
.home-discover__topic:focus-visible {
  outline: none;
  border-color: #a5abf0;
  box-shadow: 0 4px 14px rgba(67, 56, 202, 0.1);
}

.home-discover__icon {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
}

.home-discover__icon--green { background: #e3f4ea; color: #2f7d52; }
.home-discover__icon--blue { background: #e2ebff; color: #3b5bdb; }
.home-discover__icon--apricot { background: #fdebd9; color: #b45a1e; }
.home-discover__icon--pink { background: #fce4ee; color: #b8326a; }
.home-discover__icon--lavender { background: #ece6fb; color: #6b3fbf; }

.home-discover__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.home-discover__name {
  font-size: 0.9375rem;
  font-weight: 700;
}

.home-discover__desc {
  font-size: 0.75rem;
  color: #525a8a;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.home-discover__topic--enter {
  justify-content: center;
  background: transparent;
  border: 1px dashed #b9bef5;
  color: #4338ca;
  font-size: 0.9375rem;
  font-weight: 600;
}

.home-discover__topic--enter:hover,
.home-discover__topic--enter:focus-visible {
  background: #ffffff;
  border-style: solid;
}

/* KLW Guides band */
.home-guides {
  padding: 0 var(--page-gutter);
}

.home-guides__inner {
  max-width: var(--home-content-width);
  margin: 0 auto;
  padding: 1.5rem 0.5rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 18.75rem minmax(0, 1fr);
  align-items: stretch;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.home-guides__head {
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-guides__title-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.home-guides__icon {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.home-guides__title {
  font-size: 1.375rem;
  font-weight: 700;
}

.home-guides__title a {
  color: inherit;
  text-decoration: none;
}

.home-guides__title a:hover {
  color: var(--color-primary);
}

.home-guides__intro {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #475569;
}

.home-guides__browse {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.home-guides__browse:hover {
  text-decoration: underline;
}

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

.home-guides__list:empty {
  display: none;
}

.home-guides__item {
  padding: 0.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  border-left: 1px solid var(--color-surface-subtle);
  color: var(--color-text);
  text-decoration: none;
}

.home-guides__item:hover .home-guides__item-title {
  color: var(--color-primary);
}

.home-guides__item-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

.home-guides__item-meta {
  font-size: 0.75rem;
  color: var(--color-subtitle);
}

.home-guides__status {
  align-self: center;
  padding: 0 1.5rem;
  font-size: 0.875rem;
  color: var(--color-subtitle);
}

.home-guides__status--error {
  color: var(--color-error);
}

/* KLW 实用 */
.home-practical {
  padding: 2.5rem var(--page-gutter) 0;
}

.home-practical__inner {
  max-width: var(--home-content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.home-section-head__title {
  font-size: 1.5rem;
  font-weight: 700;
}

.home-section-head__meta {
  font-size: 0.875rem;
  color: var(--color-subtitle);
}

.home-practical__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.home-practical__card {
  padding: 1.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-practical__card:hover,
.home-practical__card:focus-visible {
  outline: none;
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

.home-practical__label {
  font-size: 0.8125rem;
  font-weight: 700;
}

.home-practical__label--amber { color: var(--color-warning); }
.home-practical__label--blue { color: var(--color-primary); }
.home-practical__label--green { color: var(--color-success); }

.home-practical__desc {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

.home-practical__more {
  font-size: 0.8125rem;
  color: var(--color-subtitle);
}

/* Community preview */
.home-hero .hero-search__clear[hidden] {
  display: none;
}

.home-community .posts__heading {
  font-size: 1.5rem;
}

.home-community {
  padding-top: 2.5rem;
  padding-bottom: 4.5rem;
}

.home-community .posts__header {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  text-align: left;
}

.home-community .posts__heading-group,
.home-community .posts__heading {
  text-align: left;
}

.home-community__all {
  flex: 0 0 auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.home-community__all:hover {
  text-decoration: underline;
}

.home-community__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.25rem;
}

.home-community__more,
.home-community__create {
  min-height: 2.75rem;
  padding: 0 1.375rem;
  display: inline-flex;
  align-items: center;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.home-community__more {
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.home-community__more:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.home-community__create {
  background: var(--color-primary);
  color: #ffffff;
}

.home-community__create:hover {
  background: var(--color-primary-hover);
}

/* Footer */
.home-footer {
  padding: 2.25rem var(--page-gutter);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.home-footer__inner {
  max-width: var(--home-content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.home-footer__brand {
  font-size: 0.9375rem;
  font-weight: 700;
}

.home-footer__disclaimer {
  max-width: 34rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--color-subtitle);
  text-align: right;
}

@media (min-width: 1025px) {
  .home-community .posts__inner {
    max-width: var(--home-content-width);
  }

  .home-community .posts__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

@media (max-width: 1024px) {
  .home-hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-guides__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 1.5rem;
  }

  .home-guides__head {
    padding-right: 0;
  }

  .home-guides__item:first-child {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 768px) {
  .navbar--home .navbar__actions {
    margin-left: 0;
  }

  .navbar__spacer {
    flex: 0 0 0.25rem;
  }

  .home-hero {
    padding: 2rem var(--page-gutter-mobile) 1.5rem;
  }

  .home-guides,
  .home-practical {
    padding-left: var(--page-gutter-mobile);
    padding-right: var(--page-gutter-mobile);
  }

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

  .home-guides__item {
    padding: 0.75rem 0;
    border-left: none;
    border-top: 1px solid var(--color-surface-subtle);
  }

  .home-discover__head,
  .home-section-head,
  .home-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-footer__disclaimer {
    text-align: left;
  }
}

/* ── PM-03 homepage integration ──
   Listings entries in the home sub-nav, the "最新布告" block, and the
   homepage community card layout. Everything here is scoped to
   .home-subnav / .home-listings / .home-community, so other pages that
   reuse .post-card or .listings-grid are unaffected. */

.home-subnav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.home-subnav__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.home-subnav__link:hover {
  color: var(--color-primary);
}

.home-subnav__link:focus-visible {
  outline: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--focus-ring);
}

.home-listings {
  padding: 2.5rem var(--page-gutter) 0;
}

.home-listings__inner {
  max-width: var(--home-content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.home-listings .home-section-head__title a {
  color: inherit;
  text-decoration: none;
}

.home-listings .home-section-head__title a:hover {
  color: var(--color-primary);
}

.home-listings__grid[hidden] {
  display: none;
}

.home-listings__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Homepage community cards: text on the left, fixed thumbnail on the right.
   Title max 2 lines, body max 3 lines, cards in a row share one height and
   the footer sits on the bottom edge. The thumbnail is cropped with
   object-fit: cover and never stretched. */
.home-community .post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.home-community .post-card__link {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
}

.home-community .post-card__header,
.home-community .post-card__content,
.home-community .post-card__summary {
  grid-column: 1;
  min-width: 0;
}

.home-community .post-card__header {
  grid-row: 1;
}

.home-community .post-card__content {
  grid-row: 2;
}

.home-community .post-card__media {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  width: 6rem;
  height: 6rem;
  margin: 0 0 0 1rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle);
}

.home-community .post-card__media[hidden] {
  display: none;
}

.home-community .post-card__media-image {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.home-community .post-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.home-community .post-card__content {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
}

.home-community .post-card__footer {
  margin-top: auto;
}

@media (max-width: 768px) {
  .home-subnav__inner {
    flex-wrap: wrap;
    column-gap: 1rem;
    row-gap: 0;
    padding-left: var(--page-gutter-mobile);
    padding-right: var(--page-gutter-mobile);
  }

  .home-subnav__links {
    flex-wrap: wrap;
    column-gap: 1rem;
    row-gap: 0;
  }

  .home-listings {
    padding-left: var(--page-gutter-mobile);
    padding-right: var(--page-gutter-mobile);
  }

  /* Narrow screens: title and tags keep the full width; the thumbnail sits
     beside the (max 3-line) body text instead of squeezing the title. */
  .home-community .post-card__header {
    grid-column: 1 / -1;
  }

  .home-community .post-card__media {
    grid-row: 2;
    width: 4.5rem;
    height: 4.5rem;
    margin-left: 0.75rem;
  }
}

/* ── Mobile main navigation (≤768px) ──
   Browsing pages that carry the fixed bottom bar (global-create.js adds
   body.has-bottom-nav) drop the duplicated top page links and keep only the
   logo, language, account entry and notifications bell. Pages that hide the
   bar (create-page, my-klw-page) or never load it keep their top nav, so no
   page is left without a way back. Desktop is unaffected. */

.navbar__user-badge {
  display: none;
}

@media (max-width: 768px) {
  body.has-bottom-nav:not(.create-page):not(.my-klw-page) .navbar__links > a.navbar__link {
    display: none;
  }

  body.has-bottom-nav .klw-global-create__inner {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: 32rem;
  }

  body.has-bottom-nav .klw-global-create__item {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }

  .navbar__user {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
  }

  .navbar__user-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .navbar__user-badge:not([hidden]) {
    display: inline-block;
    flex: 0 0 auto;
    min-width: 1.1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--color-danger, #dc2626);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.1rem;
    text-align: center;
  }

  /* One unread indicator per page: when a visible bell is already showing
     its unread count, the account badge stays hidden. Without a bell (or
     with the bell hidden), the account badge carries the count. */
  .navbar__links:has(.navbar__bell:not([hidden]) .navbar__bell-badge:not([hidden])) .navbar__user-badge {
    display: none;
  }
}

/* Notifications page: desktop keeps its original bar (klw-global-create
   --desktop, 首页 | 发现 | ＋ | 我的); mobile uses the five-item bar. */
@media (min-width: 769px) {
  .notifications-page .klw-global-create--mobile {
    display: none;
  }
}

@media (max-width: 768px) {
  .notifications-page .klw-global-create--desktop {
    display: none;
  }
}

/* ── Mobile spacing polish (homepage, ≤768px) ──
   Tightens blank space only: section gaps, card padding, header height.
   Font sizes, tap targets (nothing made smaller), the fixed bottom bar and
   all desktop rules are unchanged. Every selector is scoped to the homepage. */
@media (max-width: 768px) {
  /* Header: slightly flatter brand bar */
  .navbar--home {
    min-height: 3.25rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  /* Hero */
  .home-hero {
    padding: 1.25rem var(--page-gutter-mobile) 1rem;
  }

  .home-hero__inner {
    gap: 1.25rem;
  }

  .home-hero__search {
    gap: 0.75rem;
  }

  /* Search: input and button on one row (overrides the ≤640px stacking) */
  .home-hero .hero-search__field {
    flex-wrap: nowrap;
    padding: 0.375rem 0.375rem 0.375rem 0.75rem;
  }

  .home-hero .hero-search__input {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
  }

  .home-hero .hero-search__clear {
    order: 2;
    margin-left: 0;
  }

  .home-hero .hero-search__submit {
    order: 3;
    width: auto;
    min-height: 2.75rem;
  }

  /* 大家在搜: one row, scrolls sideways */
  .home-popular {
    flex-wrap: nowrap;
    min-width: 0;
  }

  .home-popular__label {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .home-popular__list {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .home-popular__list::-webkit-scrollbar {
    display: none;
  }

  .home-popular__chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Mobile shows the first three popular searches only (desktop keeps all). */
  .home-popular__list > .home-popular__chip:nth-child(n+4) {
    display: none;
  }

  /* Discover: names only on mobile */
  .home-discover {
    padding: 0.875rem 1rem;
  }

  .home-discover__desc {
    display: none;
  }

  /* KLW Guides */
  .home-guides__inner {
    padding: 1rem;
    gap: 0.75rem;
  }

  /* Section rhythm: 40px -> 24px between sections, tighter heads */
  .home-listings,
  .home-practical {
    padding-top: 1.5rem;
  }

  .home-community {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }

  .home-listings__inner,
  .home-practical__inner {
    gap: 0.75rem;
  }

  .home-section-head {
    gap: 0.25rem;
  }

  /* 最新布告: 4 on mobile, slightly tighter cards */
  .home-listings__grid {
    gap: 0.75rem;
  }

  .home-listings__grid > li:nth-child(n+5) {
    display: none;
  }

  .home-listings .listing-card {
    padding: 1rem;
  }

  /* KLW 实用: same three cards, flatter */
  .home-practical__grid {
    gap: 0.625rem;
  }

  .home-practical__card {
    padding: 0.875rem 1rem;
    gap: 0.375rem;
  }

  /* 社区 */
  .home-community .posts__header {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .home-community .posts__list {
    gap: 0.75rem;
  }

  .home-community .post-card {
    padding: 1rem;
  }

  .home-community .post-card__header {
    margin-bottom: 0.625rem;
  }

  .home-community .post-card__title {
    margin-bottom: 0.5rem;
  }

  .home-community .post-card__content {
    margin-bottom: 0.75rem;
  }

  .home-community .post-card__translate {
    margin-bottom: 0.5rem;
  }

  .home-community .post-card__translate-btn {
    padding-left: 0;
    padding-right: 0;
    border-color: transparent;
    background: transparent;
    color: var(--color-primary);
  }

  .home-community .post-card__footer {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 0.625rem;
  }

  .home-community__actions {
    padding-top: 1rem;
  }

  /* Home previews, the community page browses: mobile shows the first two
     posts (desktop keeps four) and drops the duplicate "全部讨论" link;
     "进入社区看更多" below the posts and the bottom-bar 社区 remain. */
  .home-community .posts__list > .post-card:nth-child(n+3) {
    display: none;
  }

  .home-community__all {
    display: none;
  }

  .home-footer {
    padding: 1.5rem var(--page-gutter-mobile);
  }
}
