html.i18n-pending body {
  visibility: hidden;
}

:root,
[data-theme="black"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #616161;
  --accent: #616161;
  --accent-hover: #757575;
  --border: #dedede;
  --chrome-bg: #dedede;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="red"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #616161;
  --accent: #e57373;
  --accent-hover: #ef5350;
  --border: #ffcdd2;
  --chrome-bg: #ffcdd2;
  --shadow: 0 1px 3px rgba(229, 115, 115, 0.12);
}

[data-theme="green"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #616161;
  --accent: #21b66b;
  --accent-hover: #1a9a59;
  --border: #e8f5e9;
  --chrome-bg: #e8f5e9;
  --shadow: 0 1px 3px rgba(33, 182, 107, 0.12);
}

[data-theme="blue"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #616161;
  --accent: #1976d2;
  --accent-hover: #1565c0;
  --border: #e3f2fd;
  --chrome-bg: #e3f2fd;
  --shadow: 0 1px 3px rgba(25, 118, 210, 0.12);
}

[data-theme="purple"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #616161;
  --accent: #ab47bc;
  --accent-hover: #9c27b0;
  --border: #e1bee7;
  --chrome-bg: #e1bee7;
  --shadow: 0 1px 3px rgba(171, 71, 188, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

header {
  border-bottom: 3px solid var(--accent);
  background: var(--chrome-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-bar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0 0.25rem;
}

.nav {
  padding: 0.25rem 0 0.75rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.9375rem;
}

.brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links a {
  color: var(--muted);
  padding: 0.3rem 0.6rem;
  border-radius: 0.375rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent-hover);
  text-decoration: none;
  background: color-mix(in srgb, var(--accent) 12%, var(--chrome-bg));
}

.nav-links a.active {
  color: var(--accent-hover);
  font-weight: 600;
  text-decoration: none;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.lang-picker-root {
  flex-shrink: 0;
}

.lang-picker {
  position: relative;
}

.lang-picker-toggle {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  min-width: 6rem;
  text-align: left;
  box-shadow: var(--shadow);
}

.lang-picker-toggle:hover,
.lang-picker-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.lang-picker-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 14rem;
  max-width: min(18rem, 90vw);
  max-height: min(24rem, 70vh);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(26, 35, 50, 0.12);
  overflow: hidden;
}

.lang-picker-menu[hidden] {
  display: none !important;
}

.lang-picker-search {
  margin: 0.35rem 0.35rem 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font: inherit;
  font-size: 0.875rem;
}

.lang-picker-search:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.lang-picker-status {
  margin: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.lang-picker-status.is-error {
  color: #b42318;
}

.lang-picker-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.lang-picker-loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: lang-picker-spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.lang-picker-toggle.is-loading {
  opacity: 0.7;
  cursor: wait;
}

.lang-picker-menu-list {
  display: flex;
  flex-direction: column;
  padding: 0.35rem;
  overflow-y: auto;
}

.lang-picker-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-radius: 0.375rem;
  cursor: pointer;
}

.lang-picker-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.lang-picker-item:hover,
.lang-picker-item:focus-visible {
  background: rgba(33, 182, 107, 0.08);
  outline: none;
}

.lang-picker-item.is-active {
  color: var(--accent-hover);
  font-weight: 600;
  background: #eefbf3;
}

.lang-picker-item.is-installed .lang-picker-item-badge {
  color: var(--accent-hover);
}

.lang-picker-item.is-installing .lang-picker-item-badge {
  color: #b54708;
}

.lang-picker-item.is-partial .lang-picker-item-badge {
  color: #175cd3;
}

.lang-picker-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.lang-picker-item-progress {
  display: block;
  width: 100%;
  height: 0.25rem;
  background: #e8edf5;
  border-radius: 999px;
  overflow: hidden;
}

.lang-picker-item-progress-bar {
  display: block;
  height: 100%;
  background: #21b66b;
}

.lang-picker-item.is-installing .lang-picker-item-progress-bar {
  background: #f79009;
}

.lang-picker-item.is-partial .lang-picker-item-progress-bar {
  background: #528bff;
}

.lang-picker-item-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  line-height: 1.35;
}

.lang-picker-item-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  line-height: 1.35;
  white-space: nowrap;
}

.lang-picker-toast {
  margin: 0.45rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(33, 182, 107, 0.35);
  background: #eefbf3;
  color: #166534;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.lang-picker-toast.is-error {
  border-color: rgba(180, 35, 24, 0.25);
  background: #fef3f2;
  color: #b42318;
}

.lang-picker-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

.lang-picker-item-add {
  color: var(--accent-hover);
  font-weight: 600;
}

.lang-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.lang-dialog-overlay.hidden {
  display: none;
}

.lang-dialog {
  width: min(100%, 28rem);
  max-height: min(80vh, 34rem);
  background: var(--surface);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(26, 35, 50, 0.18);
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.lang-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.lang-dialog-header h2 {
  margin: 0;
  font-size: 1.125rem;
}

.lang-dialog-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.lang-dialog-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  margin-bottom: 0.65rem;
}

.lang-dialog-status {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.lang-dialog-status.is-error {
  color: #b42318;
}

.lang-dialog-status.hidden {
  display: none;
}

.lang-dialog-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lang-dialog-item {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.lang-dialog-item:hover,
.lang-dialog-item:focus-visible {
  background: rgba(33, 182, 107, 0.08);
  outline: none;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.hero {
  padding: 2rem 0 2.5rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 42rem;
  margin: 0 0 1.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  text-decoration: none;
}

.btn-disabled {
  background: #eef2f7;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: default;
  pointer-events: none;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.download-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.download-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.download-card-soon .download-btn.btn-disabled {
  pointer-events: none;
}

.download-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 600;
}

.download-btn {
  display: inline-block;
  text-decoration: none;
}

.download-btn:hover {
  text-decoration: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.375rem;
}

h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.0625rem;
}

p, ul, ol {
  margin: 0 0 1rem;
}

ul, ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.35rem;
}

.note {
  background: #eefbf3;
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.hidden {
  display: none !important;
}

.ask-form {
  margin: 1.5rem 0;
}

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

.ask-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
}

.ask-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ask-hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
}

.ask-field-error {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  color: #b42318;
}

.ask-form textarea[aria-invalid="true"] {
  border-color: #b42318;
}

.support-form input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  background: var(--surface);
  color: var(--text);
}

.support-file-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  position: relative;
}

.support-file-input {
  display: none;
}

.support-file-name {
  font-size: 0.9375rem;
  color: var(--muted);
  word-break: break-word;
}

.support-file-choose {
  flex-shrink: 0;
}

.support-form input[type="email"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.support-form input[type="email"][aria-invalid="true"] {
  border-color: #b42318;
}

.support-subheading {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.support-metadata {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.support-metadata div {
  margin: 0;
}

.support-metadata dt {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.15rem;
}

.support-metadata dd {
  margin: 0;
  font-size: 0.9375rem;
  word-break: break-word;
}

.support-screenshot-preview {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.support-screenshot-remove {
  border: none;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.ask-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ask-submit {
  border: none;
  cursor: pointer;
}

.ask-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ask-status {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.ask-suggestions h2 {
  font-size: 1rem;
  margin-top: 2rem;
}

.ask-suggestion-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ask-suggestion-list li {
  margin-bottom: 0.5rem;
}

.ask-suggestion-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow);
}

.ask-suggestion-btn:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.ask-answer {
  margin-top: 2rem;
}

.ask-loading {
  color: var(--muted);
  font-style: italic;
}

.ask-answer-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  white-space: pre-wrap;
}

.ask-experimental-tag {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: italic;
}

.ask-answer-actions {
  margin-top: 0.75rem;
}

.ask-answer-actions .btn {
  font-size: 0.9375rem;
}

.ask-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
}

.ask-feedback-label {
  font-size: 0.9375rem;
  color: var(--muted);
}

.ask-thumb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.35rem 0.6rem;
  font-size: 1.125rem;
  cursor: pointer;
  line-height: 1;
}

.ask-thumb:hover {
  border-color: var(--accent);
}

.ask-feedback-thanks {
  font-size: 0.875rem;
  color: var(--muted);
}

.ask-privacy {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 2rem;
}

.ask-disclaimer {
  margin-top: 1rem;
}

footer {
  border-top: 3px solid var(--accent);
  background: var(--chrome-bg);
  padding: 2rem 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-copyright {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.35;
}

.footer-copyright a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.footer-copyright a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer-privacy-note {
  max-width: 960px;
  margin: 1.25rem auto 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0.85;
  text-align: center;
}

.theme-picker-root {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 12rem;
}

.theme-picker {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.theme-picker-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.theme-picker-options {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.theme-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.theme-swatch-color {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.theme-swatch:hover,
.theme-swatch:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.theme-swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--chrome-bg), 0 0 0 4px var(--accent);
}

@media (max-width: 600px) {
  main {
    padding-top: 1.5rem;
  }

  .site-header-top {
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .theme-picker-root {
    width: 100%;
    justify-content: center;
  }

  .footer-links {
    justify-content: center;
  }
}
