@font-face {
  font-family: Inter;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
:root {
  --ground: #0a0a0a;
  --surface: #141414;
  --raised: #1c1c1e;
  --active: rgba(10, 132, 255, 0.14);
  --border: #262626;
  --control: #3a3a3c;
  --text: #f5f5f7;
  --muted: #b0b0b8;
  --link: #0a84ff;
  --link-hover: #64d2ff;
  --accent: #0066cc;
  --accent-hover: #006d8f;
  --mono: #30d158;
  --positive: #30d158;
  --negative: #ff453a;
  --radius: 8px;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--ground);
  font-size: 15px;
  line-height: 1.6;
}
[data-theme="light"] {
  --ground: #ffffff;
  --surface: #f5f5f7;
  --raised: #e8e8ed;
  --active: rgba(0, 102, 204, 0.12);
  --border: #d2d2d7;
  --control: #b0b0b5;
  --text: #1d1d1f;
  --muted: #5f6368;
  --link: #0066cc;
  --link-hover: #007a99;
  --accent: #0066cc;
  --accent-hover: #007a99;
  --positive: #137333;
  --negative: #c41a22;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: rgba(10, 132, 255, 0.25);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  touch-action: manipulation;
}
button,
a.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
button:hover:not(:disabled),
a.download:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--control);
  font-weight: 500;
}
.quiet:hover:not(:disabled) {
  background: transparent;
  border-color: var(--text);
  color: var(--text);
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
.mono {
  font-family: var(--font-mono);
  color: var(--mono);
}
input,
select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--ground);
  color: var(--text);
  border: 1px solid var(--control);
  border-radius: var(--radius);
}
input[type="color"] {
  padding: 4px;
}
input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--link);
  width: 18px;
  min-height: 18px;
  margin: 0;
  flex-shrink: 0;
}
::placeholder {
  color: var(--muted);
}
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
#main:focus {
  outline: none;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 16px;
}
label input,
label select {
  display: block;
  margin-top: 6px;
  font-weight: 400;
}
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 30;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.skip-link:focus {
  top: 8px;
  color: #fff;
  text-decoration: none;
}
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.navbar-brand:hover {
  color: var(--text);
  text-decoration: none;
}
.brand-sep {
  margin: 0 0.35rem;
  color: var(--muted);
  font-weight: 400;
}
.navbar-brand .mono {
  font-weight: 500;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 0;
}
.navbar-nav a,
.navbar-nav button {
  background: none;
  border: none;
  border-radius: 0;
  min-height: 0;
  padding: 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.navbar-nav a:hover,
.navbar-nav button:hover,
.navbar-nav a.active {
  background: none;
  border: none;
  color: var(--text);
  text-decoration: none;
}
#account {
  margin-left: auto;
  max-width: 220px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theme-toggle,
.navbar-toggle {
  background: none;
  border: none;
  color: var(--muted);
  min-width: 40px;
  min-height: 40px;
  padding: 8px;
  flex: 0 0 auto;
}
.theme-toggle:hover,
.navbar-toggle:hover {
  background: none;
  border: none;
  color: var(--text);
}
.theme-toggle svg {
  display: block;
}
.theme-toggle .icon-sun,
[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}
[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}
.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.navbar-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 3px 0;
  background: currentColor;
}
h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 8px;
  font-weight: 600;
}
h2 {
  font-size: 1.0625rem;
  margin: 0 0 16px;
  font-weight: 600;
}
p {
  margin: 0 0 16px;
}
h1 + p,
.hint {
  color: var(--muted);
}
.hint {
  font-size: 0.8125rem;
  margin: 8px 0 0;
}
main {
  padding-top: 64px;
}
.shell,
.docs {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
.title-row,
.section-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.title-row {
  align-items: start;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-row h2 {
  margin: 0;
}
.section-row {
  margin-bottom: 16px;
}
.status {
  padding: 4px 8px;
  background: var(--active);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}
.url-form {
  margin-bottom: 32px;
}
.url-form label {
  margin-bottom: 8px;
}
.inline {
  display: flex;
  gap: 12px;
  align-items: start;
}
.inline > input {
  flex: 1;
}
.inline > label {
  flex: 1;
  min-width: 0;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 32px;
}
.media-panel,
.compose-panel {
  min-width: 0;
}
.compose-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 12px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 12px;
  margin: 0;
  font-weight: 400;
  overflow: hidden;
}
.media-card:has(input:checked) {
  border: 2px solid var(--link);
  padding: 7px;
}
.media-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--raised);
  display: block;
  border-radius: 8px;
  margin: 0 0 8px;
}
.media-card .check {
  margin: 0;
  font-size: 13px;
}
.media-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.media-card .no-preview {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--raised);
  color: var(--muted);
  margin-bottom: 8px;
  border-radius: 8px;
  text-align: center;
  padding: 8px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  margin: 8px 0;
}
.check input {
  margin: 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}
legend {
  font-weight: 600;
  margin-bottom: 4px;
}
.empty {
  grid-column: 1 / -1;
  display: grid;
  align-content: center;
  min-height: 210px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
}
.composition-preview {
  margin-top: 16px;
}
.composition-preview:empty {
  display: none;
}
.composition-preview img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  margin: auto;
  border-radius: 8px;
}
.selection-order {
  padding: 0;
  list-style-position: inside;
  margin: 8px 0 20px;
}
.selection-order li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.selection-order span {
  flex: 1 1 120px;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.credits-option {
  margin-top: 16px;
}
#credits-copy-text {
  width: 100%;
  padding: 12px;
  background: var(--ground);
  color: var(--text);
  border: 1px solid var(--control);
  font: inherit;
}
.credits {
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.credits details {
  margin-bottom: 8px;
  font-size: 13px;
}
.credits p {
  white-space: pre-wrap;
  color: var(--muted);
  margin-top: 8px;
}
.compose-panel > button {
  width: 100%;
}
.jobs {
  margin-top: 32px;
}
.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.job strong {
  font-size: 14px;
}
.job p,
.job a:not(.download) {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0;
  overflow-wrap: anywhere;
}
.job a:not(.download) {
  color: var(--link);
}
.job details {
  font-size: 13px;
}
.job summary {
  cursor: pointer;
}
.job pre {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
  max-width: 100%;
  margin: 8px 0 0;
}
.job .failed {
  color: var(--negative);
}
.job .completed {
  color: var(--positive);
}
.login {
  max-width: 440px;
  margin: 8vh auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.login h1 {
  font-size: 1.375rem;
}
.login p {
  color: var(--muted);
}
.login button {
  width: 100%;
}
#message {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  max-width: calc(100% - 32px);
  width: max-content;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 30;
}
#message.error {
  background: var(--negative);
  border-color: var(--negative);
  color: #fff;
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 560px;
  width: calc(100% - 32px);
  padding: 24px;
}
dialog::backdrop {
  background: rgb(0 0 0 / 55%);
}
#new-key {
  padding: 16px;
  background: var(--raised);
  border-radius: 12px;
  margin: 16px 0;
}
#key-value {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
#keys-list {
  margin-top: 20px;
}
#keys-list .key {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
#selection-count {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
}
#clear-media {
  margin-top: 12px;
}
.docs h2 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.docs pre {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  background: var(--ground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-x: auto;
  max-width: 100%;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
}
.site-footer p {
  margin: 0;
}
#editor,
#jobs {
  scroll-margin-top: 80px;
}
@media (max-width: 768px) {
  .navbar {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }
  .navbar-brand {
    font-size: 0.9375rem;
  }
  .navbar-toggle {
    display: flex;
  }
  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .navbar-nav.active {
    display: flex;
  }
  .navbar-nav a,
  .navbar-nav button,
  #account {
    margin: 0;
    padding: 12px 16px;
    text-align: left;
    justify-content: flex-start;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  main {
    padding-top: 56px;
  }
  .shell,
  .docs {
    padding: 24px 16px 40px;
  }
  h1 {
    font-size: 1.375rem;
  }
  .url-form .inline {
    flex-direction: column;
  }
  .url-form .inline > * {
    width: 100%;
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .empty {
    min-height: 130px;
  }
  .login {
    margin: 4vh 0;
    padding: 24px;
  }
  .job {
    grid-template-columns: minmax(0, 1fr);
  }
  .job .download {
    justify-self: start;
  }
  #logout {
    padding: 8px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

/* The editor keeps media and preview together, with export controls alongside. */
html:has(.tool-app) {
  scroll-padding-top: 80px;
  scroll-padding-bottom: 140px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tool-app .shell {
  max-width: 1360px;
  padding-top: 24px;
  padding-bottom: 144px;
}
.tool-app .title-row {
  margin-bottom: 20px;
}
.tool-app h1 {
  font-size: 1.25rem;
  margin: 0;
}
.tool-app .url-form {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.tool-app .editor-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}
.work-area {
  min-width: 0;
}
.tool-app .media-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.tool-app .media-card {
  border-radius: 8px;
  cursor: pointer;
}
.tool-app .media-card:hover {
  background: var(--raised);
}
.tool-app .media-card:focus-within {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}
.tool-app .media-card:has(input:checked) {
  background: var(--active);
}
.tool-app .media-card img {
  object-fit: contain;
  border-radius: 4px;
}
.count {
  display: inline-block;
  min-width: 24px;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 4px;
  background: var(--raised);
  color: var(--muted);
  font: 12px/1.6 var(--font-mono);
  text-align: center;
  vertical-align: middle;
}
.selection-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}
.tool-app #clear-media {
  margin: 0 0 0 auto;
}
.tool-app .empty {
  min-height: 240px;
  text-align: center;
  background: transparent;
  border-style: dashed;
  border-radius: 8px;
}
.tool-app .empty strong {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}
.preview-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.preview-panel .section-row {
  margin-bottom: 0;
  flex-wrap: wrap;
}
.preview-panel .composition-preview img {
  max-height: 420px;
  border-radius: 2px;
}
.tool-app .compose-panel {
  padding: 20px;
  border-radius: 8px;
}
.tool-app #export-settings {
  min-width: 0;
  margin-bottom: 0;
}
.tool-app #export-settings:disabled {
  opacity: 0.45;
}
#settings-empty {
  margin: -8px 0 16px;
}
.tool-app .mode-options .check {
  padding: 10px 12px;
  border: 1px solid var(--control);
  border-radius: 6px;
  font-size: 13px;
}
.tool-app .mode-options .check:has(input:checked) {
  background: var(--active);
  border-color: var(--link);
}
.tool-app label,
.tool-app legend {
  font-size: 13px;
}
.tool-app #format-hint {
  margin-top: -8px;
  margin-bottom: 16px;
}
.credits-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 16px;
  font-size: 13px;
}
.credits-section summary {
  cursor: pointer;
  padding: 4px 0;
}
.tool-app .credits {
  margin: 12px 0;
}
.tool-app .credits-option {
  font-size: 12px;
}
.export-action {
  position: fixed;
  bottom: 16px;
  left: 24px;
  right: 24px;
  z-index: 15;
  max-width: 1312px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: 8px;
  box-shadow: 0 4px 24px #0003;
}
#export-summary {
  font-size: 13px;
  margin: 0;
}
#export-summary.error,
#format-hint.error {
  color: var(--negative);
}
.tool-app #export {
  flex-shrink: 0;
}
.tool-app:has(#export-bar:not([hidden])) #message {
  bottom: 140px;
}
.tool-app .jobs {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding-top: 24px;
}
.tool-app .jobs .empty {
  min-height: 100px;
}
.tool-app .job .download {
  align-self: start;
}
.tool-app .job details {
  margin: 8px 0;
}
@media (min-width: 1101px) {
  .tool-app .navbar-nav {
    margin-left: 20px;
  }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .tool-app .navbar {
    gap: 12px;
    padding: 0 16px;
  }
  .tool-app .navbar-nav {
    gap: 16px;
  }
  .tool-app #account {
    max-width: 100px;
  }
  .tool-app .editor-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
  }
  .tool-app .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .tool-app .navbar-brand {
    margin-right: auto;
  }
  .tool-app .shell {
    padding-top: 20px;
  }
  .tool-app .editor-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .tool-app .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-app .empty {
    min-height: 160px;
    padding: 16px;
  }
  .tool-app .compose-panel,
  .preview-panel {
    padding: 16px;
  }
  .selection-tools {
    gap: 4px;
  }
  .selection-tools button {
    padding: 8px;
    font-size: 11px;
  }
  .export-action {
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 12px;
    gap: 12px;
  }
  .export-action .hint {
    display: none;
  }
  .tool-app #export {
    padding: 10px;
    font-size: 11px;
  }
  #export-summary {
    font-size: 12px;
  }
}
