:root {
  color-scheme: light dark;
  --bg: #f7f6f3;
  --surface: #fff;
  --text: #262825;
  --muted: #535752;
  --line: #dedfd8;
  --accent: #185fa5;
  --accent-soft: #e6f1fb;
  --green: #16604e;
  --green-soft: #e1f5ee;
  --gray-soft: #eeefe9;
  --error: #a32d2d;
  --shadow: 0 2px 9px rgb(39 48 37 / 5%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c201e;
    --surface: #252b27;
    --text: #f3f4ef;
    --muted: #c6cdc6;
    --line: #434a44;
    --accent: #9cc8ff;
    --accent-soft: #253a53;
    --green: #a2e5cb;
    --green-soft: #284339;
    --gray-soft: #343d37;
    --error: #ffb4a9;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); overflow-wrap: anywhere; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 6.8vw, 2.85rem); line-height: 1.14; overflow-wrap: anywhere; }
h2 { font-size: 1.08rem; line-height: 1.35; }
p { color: var(--muted); }

.topbar {
  padding-block-start: env(safe-area-inset-top);
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}
.topbar-inner, .shell {
  max-width: 55rem;
  margin-inline: auto;
  padding-inline: max(1rem, env(safe-area-inset-left), env(safe-area-inset-right));
}
.topbar-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.brand { display: flex; flex: none; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { flex: none; border-radius: .6rem; }
.language {
  min-width: 0;
  max-width: min(46%, 12rem);
  min-height: 2.75rem;
  padding: .35rem .5rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--surface);
  font-size: .9rem;
}
.language-picker {
  width: min(26rem, calc(100% - 2rem));
  max-height: min(36rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  color: var(--text);
}
.language-picker[open] { display: flex; flex-direction: column; }
.language-picker::backdrop { background: rgb(0 0 0 / 36%); }
.language-picker-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: .8rem;
  padding: .4rem .85rem;
  border-block-end: 1px solid var(--line);
}
.language-picker-header .back {
  padding-inline: .5rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: var(--accent);
}
.language-picker-options { overflow-y: auto; overscroll-behavior: contain; }
.language-picker-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3rem;
  padding: .6rem 1rem;
  border: 0;
  background: var(--surface);
  text-align: start;
}
.language-picker-options button + button { border-block-start: 1px solid var(--line); }
.language-picker-options button:is(:hover, [aria-pressed="true"]) {
  background: var(--accent-soft);
  color: var(--accent);
}
.language-picker-options button[aria-pressed="true"]::after { content: "✓"; }
.language-picker-options button:focus-visible { outline-offset: -3px; }
.shell { padding-block: 1.1rem max(2rem, env(safe-area-inset-bottom)); }
.request-shell { max-width: 43rem; }
.back { min-height: 2.75rem; display: inline-flex; align-items: center; gap: .28rem; font-weight: 600; text-decoration: none; }
[dir="rtl"] .back svg, [dir="rtl"] .chevron { transform: scaleX(-1); }
.intro { margin-block: .8rem 1.45rem; }
.intro p { margin-block-start: .65rem; max-width: 48ch; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.action-card, .panel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.action-card, .contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .8rem;
  padding: 1rem;
}
.action-card { min-height: 7.2rem; color: var(--text); text-decoration: none; }
.action-card:is(:hover, :focus-visible) { border-color: var(--accent); }
.action-card .chevron { align-self: center; }
.action-card p, .contact p { font-size: .91rem; margin-block-start: .33rem; }
.icon {
  display: inline-grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: .75rem;
}
.icon-feedback { color: var(--accent); background: var(--accent-soft); }
.icon-privacy { color: var(--green); background: var(--green-soft); }
.icon-contact { color: var(--muted); background: var(--gray-soft); }
.chevron { color: var(--muted); flex: none; }
.contact { margin-block: .9rem; }
.contact a { display: inline-block; padding-block: .45rem .1rem; }
.link-list { margin-block-start: .9rem; }
.link-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  min-height: 3.1rem;
  padding: .55rem 1rem;
  text-decoration: none;
  color: var(--text);
}
.link-list a + a { border-block-start: 1px solid var(--line); }
.link-list a:hover span { text-decoration: underline; }
.ffmpeg-notices summary {
  min-height: 3.1rem;
  padding: .7rem 1rem;
  cursor: pointer;
}
.ffmpeg-notices details + details { border-block-start: 1px solid var(--line); }
.ffmpeg-notice-body {
  padding: 0 1rem 1rem;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.form, .message { display: grid; gap: 1rem; padding: clamp(1rem, 4vw, 1.45rem); }
.field { display: grid; gap: .35rem; min-width: 0; }
.field label { font-weight: 600; }
.field :is(input, textarea, select) {
  width: 100%;
  min-height: 2.75rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--bg);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field-hint, .error { font-size: .9rem; }
.error { color: var(--error); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 2.75rem;
  padding: .45rem 1rem;
  border: 0;
  border-radius: .62rem;
  background: var(--accent);
  color: var(--surface);
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.button:disabled { opacity: .65; cursor: default; }
.message .email { justify-self: start; }
#request-result h2 { font-size: 1.25rem; }

@media (max-width: 39rem) {
  .action-grid { grid-template-columns: minmax(0, 1fr); }
  .action-card { min-height: 5.2rem; }
}

@media (max-width: 23rem) {
  .brand { font-size: .88rem; }
  .brand img { width: 32px; height: 32px; }
  .action-card, .contact { gap: .55rem; padding: .75rem; }
}
