:root {
  --sticky-header-offset: 5.5rem;
  --admin-sticky-header-offset: 5.5rem;
}

html {
  min-height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}

.scroll-anchor-target {
  scroll-margin-top: calc(var(--sticky-header-offset) + 1rem);
}

.admin-scroll-anchor-target {
  scroll-margin-top: calc(var(--admin-sticky-header-offset) + 1rem);
}

body {
  margin: 0;
  background-color: var(--color-surface-50);
  color: var(--color-surface-900);
  font-family: var(--font-sans);
}

.frontend-select-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.frontend-select-label {
  color: var(--theme-frontend-select-label);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.frontend-select-shell {
  position: relative;
  display: block;
}

.frontend-select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: inherit;
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid var(--theme-frontend-select-border);
  border-radius: 1rem;
  background: var(--theme-frontend-select-background);
  padding: 0.85rem 3rem 0.85rem 1rem;
  color: var(--theme-frontend-select-text);
  font-size: 0.875rem;
  line-height: 1.5rem;
  box-shadow: var(--theme-frontend-select-shadow);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.frontend-select:hover {
  border-color: var(--theme-frontend-select-border-hover);
  background: var(--theme-frontend-select-background-hover);
}

.frontend-select:focus {
  border-color: var(--theme-frontend-select-focus-border);
  box-shadow: var(--theme-frontend-select-focus-ring);
  transform: translateY(-1px);
}

.frontend-select option {
  background-color: var(--theme-surface-card);
  color: var(--theme-text-primary);
}

.frontend-select-icon {
  position: absolute;
  top: 50%;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--theme-frontend-select-icon);
  pointer-events: none;
  transform: translateY(-50%);
  transition: color 0.2s ease, transform 0.2s ease;
}

.frontend-select-shell:focus-within .frontend-select-icon {
  color: var(--theme-frontend-select-icon-active);
  transform: translateY(-50%) rotate(180deg);
}

.frontend-select-icon svg {
  width: 100%;
  height: 100%;
}

.frontend-search-suggestions {
  overflow: hidden;
  border: 1px solid var(--theme-frontend-search-suggestions-border);
  border-radius: 1rem;
  background-color: var(--theme-frontend-search-suggestions-background);
  box-shadow: var(--theme-frontend-search-suggestions-shadow);
}

.frontend-search-suggestion-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--theme-frontend-search-suggestion-divider);
  padding: 0.75rem 1rem;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.frontend-search-suggestion-item:last-child {
  border-bottom: 0;
}

.frontend-search-suggestion-item:hover,
.frontend-search-suggestion-item:focus-visible {
  background-color: var(--theme-frontend-search-suggestion-hover-background);
  outline: none;
}

.frontend-search-suggestion-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--theme-frontend-search-suggestion-text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}

.frontend-search-suggestion-badge {
  flex-shrink: 0;
  border-radius: 9999px;
  background-color: var(--theme-frontend-search-suggestion-badge-background);
  padding: 0.25rem 0.625rem;
  color: var(--theme-frontend-search-suggestion-badge-text);
  font-size: 0.75rem;
  font-weight: 600;
}

.frontend-pagination-card {
  border: 1px solid var(--theme-frontend-pagination-border);
  border-radius: 1.5rem;
  background-color: var(--theme-frontend-pagination-background);
  box-shadow: var(--theme-frontend-pagination-shadow);
}

.frontend-pagination-summary {
  color: var(--theme-frontend-pagination-summary);
}

.frontend-pagination-link {
  border: 1px solid var(--theme-frontend-pagination-link-border);
  background-color: var(--theme-frontend-pagination-link-background);
  color: var(--theme-frontend-pagination-link-text);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.frontend-pagination-link:hover {
  border-color: var(--theme-frontend-pagination-link-border-hover);
  background-color: var(--theme-frontend-pagination-link-background-hover);
  color: var(--theme-frontend-pagination-link-text);
  text-decoration: none;
}

.frontend-pagination-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-brand-text) 18%, transparent);
}

.frontend-pagination-link-disabled {
  border-color: var(--theme-frontend-pagination-link-border);
  background-color: var(--theme-frontend-pagination-link-disabled-background);
  color: var(--theme-frontend-pagination-link-disabled-text);
}

.frontend-pagination-link-active {
  border-color: var(--theme-frontend-pagination-link-active-border);
  background-color: var(--theme-frontend-pagination-link-active-background);
  color: var(--theme-frontend-pagination-link-active-text);
}

.frontend-pagination-link-primary {
  border-color: var(--theme-frontend-pagination-link-primary-border);
  background-color: var(--theme-frontend-pagination-link-primary-background);
  color: var(--theme-frontend-pagination-link-primary-text);
}

.frontend-pagination-link-primary:hover {
  border-color: var(--theme-frontend-pagination-link-primary-border);
  background-color: var(--theme-frontend-pagination-link-primary-background-hover);
  color: var(--theme-frontend-pagination-link-primary-text);
}

.frontend-pagination-link-load-more {
  border-color: var(--theme-frontend-pagination-link-load-more-border);
  background-color: var(--theme-frontend-pagination-link-load-more-background);
  color: var(--theme-frontend-pagination-link-load-more-text);
}

.frontend-pagination-link-load-more:hover {
  border-color: var(--theme-frontend-pagination-link-load-more-border-hover);
  background-color: var(--theme-frontend-pagination-link-load-more-background-hover);
  color: var(--theme-frontend-pagination-link-load-more-text);
}

.frontend-pagination-ellipsis {
  color: var(--theme-frontend-pagination-ellipsis);
}

.comment-feedback-success {
  border: 1px solid var(--theme-comment-feedback-success-border);
  background: var(--theme-comment-feedback-success-background);
  color: var(--theme-comment-feedback-success-text);
}

.comment-feedback-error {
  border: 1px solid var(--theme-comment-feedback-error-border);
  background: var(--theme-comment-feedback-error-background);
  color: var(--theme-comment-feedback-error-text);
}

.comment-validation-title {
  color: var(--theme-comment-validation-title);
}

.comment-composer {
  border: 1px solid var(--theme-comment-composer-border);
  background: var(--theme-comment-composer-background);
  box-shadow: var(--theme-comment-composer-shadow);
}

.comment-composer-badge {
  background: var(--theme-comment-composer-badge-background);
  color: var(--theme-comment-composer-badge-text);
}

.comment-composer-title {
  color: var(--theme-comment-composer-title);
}

.comment-composer-description {
  color: var(--theme-comment-composer-description);
}

.comment-field-label {
  color: var(--theme-comment-field-label);
}

.comment-input {
  border: 1px solid var(--theme-comment-field-border);
  background: var(--theme-comment-field-background);
  color: var(--theme-comment-field-text);
}

.comment-input::placeholder {
  color: var(--theme-comment-field-placeholder);
}

.comment-input:focus {
  border-color: var(--theme-comment-field-focus-border);
  box-shadow: var(--theme-comment-field-focus-ring);
}

.comment-help-text {
  color: var(--theme-comment-help-text);
}

.comment-character-count {
  color: var(--theme-comment-character-count);
}

.comment-character-count-warning {
  color: var(--theme-warning-text);
}

.comment-character-count-danger {
  color: var(--theme-danger-text);
}

.comment-input-invalid {
  border-color: var(--theme-comment-input-invalid-border) !important;
  background: var(--theme-comment-input-invalid-background) !important;
}

.comment-input-invalid:focus {
  border-color: var(--theme-comment-input-invalid-focus-border) !important;
  box-shadow: var(--theme-comment-input-invalid-focus-ring) !important;
}

.comment-list-item {
  border: 1px solid var(--theme-comment-card-border);
  background: var(--theme-comment-card-background);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.comment-list-item:hover {
  border-color: var(--theme-comment-card-border-hover);
  background: var(--theme-comment-card-background-hover);
}

.comment-item-header {
  align-items: flex-start;
}

.comment-item-identity {
  min-width: 0;
  flex: 1 1 auto;
}

.comment-item-identity > div {
  min-width: 0;
  flex: 1 1 auto;
}

.comment-avatar {
  flex-shrink: 0;
  background: var(--theme-comment-avatar-background);
  color: var(--theme-comment-avatar-text);
}

.comment-author {
  display: block;
  color: var(--theme-comment-author-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.comment-meta,
.comment-role {
  color: var(--theme-comment-meta-text);
}

.comment-content {
  color: var(--theme-comment-content-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.comment-empty-state {
  border-color: var(--theme-comment-empty-border);
  background: var(--theme-comment-empty-background);
  color: var(--theme-comment-empty-text);
}

.comment-submit-button:disabled {
  background: var(--theme-comment-submit-disabled-background);
  color: var(--theme-comment-submit-disabled-text);
  box-shadow: var(--theme-comment-submit-disabled-shadow);
}

.comment-privacy-panel {
  border: 1px solid var(--theme-comment-privacy-border);
  background: var(--theme-comment-privacy-background);
  color: var(--theme-comment-privacy-text);
}

.comment-closed-notice {
  border: 1px solid var(--theme-comment-closed-border);
  background: var(--theme-comment-closed-background);
  color: var(--theme-comment-closed-text);
}

@media (max-width: 640px) {
  .frontend-select {
    min-height: 3rem;
    padding-right: 2.75rem;
  }

  .comment-section {
    border-radius: 1.5rem;
    padding: 1.25rem;
  }

  .comment-section-header,
  .comment-list-header,
  .comment-composer-header,
  .comment-form-actions,
  .comment-item-header {
    align-items: flex-start;
  }

  .comment-section-count {
    max-width: 100%;
    padding: 0.5rem 0.875rem;
    line-height: 1.4;
    white-space: normal;
  }

  .comment-composer {
    border-radius: 1.5rem;
    padding: 1rem;
  }

  .comment-form {
    margin-top: 1rem;
    gap: 0.875rem;
  }

  .comment-input {
    min-height: 2.875rem;
    padding: 0.875rem 1rem;
  }

  .comment-content-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .comment-form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .comment-form-actions > * {
    width: 100%;
  }

  .comment-submit-button {
    width: 100%;
    min-height: 3rem;
  }

  .comment-privacy-panel,
  .comment-feedback-success,
  .comment-feedback-error,
  .comment-closed-notice,
  .comment-empty-state,
  .comment-list-item {
    border-radius: 1rem;
  }

  .comment-list-section {
    padding: 1rem;
  }

  .comment-list {
    margin-top: 1rem;
    gap: 0.875rem;
  }

  .comment-list-item {
    padding: 1rem;
  }

  .comment-item-identity {
    gap: 0.75rem;
  }

  .comment-item-time {
    width: 100%;
    text-align: left;
  }
}

.admin-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-action-button:hover {
  text-decoration: none;
}

.admin-action-button:focus-visible {
  outline: none;
  box-shadow: var(--theme-admin-button-focus-ring);
}

.admin-action-button-brand {
  border: 1px solid var(--theme-admin-brand-action-border);
  background-color: var(--theme-admin-brand-action-background);
  color: var(--theme-admin-brand-action-text);
}

.admin-action-button-brand:hover {
  border-color: var(--theme-admin-brand-action-border);
  background-color: var(--theme-admin-brand-action-background-hover);
  color: var(--theme-admin-brand-action-text);
}

.admin-action-button-danger {
  border: 1px solid var(--theme-admin-danger-action-border);
  background-color: var(--theme-admin-danger-action-background);
  color: var(--theme-admin-danger-action-text);
}

.admin-action-button-danger:hover {
  border-color: var(--theme-admin-danger-action-border);
  background-color: var(--theme-admin-danger-action-background-hover);
  color: var(--theme-admin-danger-action-text);
}

.admin-action-button-secondary {
  border: 1px solid var(--theme-admin-secondary-action-border);
  background: var(--theme-admin-secondary-action-background);
  color: var(--theme-admin-secondary-action-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-action-button-secondary:hover {
  border-color: var(--theme-admin-secondary-action-border);
  background: var(--theme-admin-secondary-action-background-hover);
  color: var(--theme-admin-secondary-action-text);
}

.admin-action-button-primary {
  border: 1px solid var(--theme-admin-primary-action-border);
  background: var(--theme-admin-primary-action-background);
  color: var(--theme-admin-primary-action-text);
  box-shadow: var(--theme-admin-primary-action-shadow);
}

.admin-action-button-primary:hover {
  border-color: var(--theme-admin-primary-action-border);
  background: var(--theme-admin-primary-action-background-hover);
  color: var(--theme-admin-primary-action-text);
}

.admin-action-button-success {
  border: 1px solid var(--theme-admin-success-action-border);
  background-color: var(--theme-admin-success-action-background);
  color: var(--theme-admin-success-action-text);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--theme-admin-success-action-background) 20%, transparent);
}

.admin-action-button-success:hover {
  border-color: var(--theme-admin-success-action-border);
  background-color: var(--theme-admin-success-action-background-hover);
  color: var(--theme-admin-success-action-text);
}

.admin-action-button-danger-solid {
  border: 1px solid var(--theme-admin-danger-solid-action-border);
  background-color: var(--theme-admin-danger-solid-action-background);
  color: var(--theme-admin-danger-solid-action-text);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--theme-admin-danger-solid-action-background) 18%, transparent);
}

.admin-action-button-danger-solid:hover {
  border-color: var(--theme-admin-danger-solid-action-border);
  background-color: var(--theme-admin-danger-solid-action-background-hover);
  color: var(--theme-admin-danger-solid-action-text);
}

.admin-action-button-warning {
  border: 1px solid var(--theme-admin-warning-action-border);
  background: var(--theme-admin-warning-action-background);
  color: var(--theme-admin-warning-action-text);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--theme-admin-warning-action-background) 20%, transparent);
}

.admin-action-button-warning:hover {
  border-color: var(--theme-admin-warning-action-border);
  background: var(--theme-admin-warning-action-background-hover);
  color: var(--theme-admin-warning-action-text);
}

