:root {
  --bg: oklch(97.8% 0.008 286);
  --panel: oklch(100% 0 0);
  --panel-muted: oklch(94.8% 0.014 286);
  --panel-raised: oklch(99.2% 0.006 286);
  --text: oklch(21% 0.018 276);
  --muted: oklch(45% 0.03 276);
  --border: oklch(87% 0.02 286);
  --border-strong: oklch(78% 0.035 286);
  --primary: oklch(58.5% 0.22 286);
  --primary-hover: oklch(51.5% 0.24 286);
  --primary-soft: oklch(93.8% 0.046 286);
  --primary-wash: oklch(97% 0.026 286);
  --on-primary: oklch(100% 0 0);
  --danger: oklch(45% 0.18 27);
  --danger-soft: oklch(95% 0.035 27);
  --warning-bg: oklch(96% 0.055 86);
  --warning-border: oklch(83% 0.105 86);
  --success: oklch(45% 0.12 151);
  --focus-ring: oklch(72% 0.15 286 / 0.42);
  --code-bg: oklch(99% 0.004 286);
  --footer-bg: oklch(18% 0.025 276);
  --footer-border: oklch(27% 0.035 276);
  --shadow: 0 10px 24px oklch(28% 0.03 276 / 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  background: linear-gradient(135deg, oklch(98.4% 0.012 286) 0%, oklch(97.3% 0.016 248) 42%, oklch(0.89 0.06 315.67) 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.site-header,
.home-workbench,
.intro-panel,
.hero,
.tool-shell,
.message-page,
.setup-warning {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 34px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--primary);
}

.nav-link[aria-current="page"] {
  color: var(--primary);
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.avatar-initial {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.92rem;
  font-weight: 800;
}

.account-dropdown {
  position: absolute;
  z-index: 30;
  inset: calc(100% + 8px) 0 auto auto;
  width: 260px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 28px oklch(28% 0.03 276 / 0.16);
}

.account-header {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 12px;
}

.account-header span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.account-menu-item:hover,
.account-menu-item:focus-visible {
  background: var(--panel-muted);
}

.inline-form {
  margin: 0;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

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

.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.account-menu summary:focus-visible,
.dropzone:focus-within {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.button-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.button-primary:hover {
  background: var(--primary-hover);
}

.button-primary-outline {
  border-color: var(--primary);
  background: var(--panel);
  color: var(--primary);
}

.button-primary-outline:hover,
.button-primary-outline:focus-visible {
  background: var(--primary);
  color: var(--on-primary);
}

.button-secondary {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.button-plain {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button-plain:hover {
  color: var(--danger);
}

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

.tool-actions,
.option-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tool-intro {
  margin: 6px 0 0;
  color: var(--muted);
}

.option-row {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.check-control,
.field-inline {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 10px;
  color: var(--text);
  font-weight: 700;
}

.field-inline select,
.symbol-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.field-inline select {
  padding: 5px 8px;
}

.setup-warning {
  margin-top: 8px;
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--warning-bg);
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 40px;
  align-items: center;
  padding: 54px 0 42px;
}

.hero-copy {
  max-width: 620px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 6px;
}

.lead {
  max-width: 55ch;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.preview-panel,
.editor-shell,
.editor-panel,
.tool-shell {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.preview-panel {
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.preview-panel pre {
  min-height: 290px;
  margin: 0;
  overflow: auto;
  padding: 22px;
  color: var(--text);
  font-size: 0.88rem;
}

.tool-shell,
.editor-panel {
  margin-bottom: 64px;
  padding: 22px;
}

main {
  flex: 1 0 auto;
  min-height: calc(95vh - 82px);
}

.home-workbench {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(280px, 0.62fr);
  gap: 26px 40px;
  align-items: center;
  margin-top: 22px;
  margin-bottom: 64px;
}

.intro-copy {
  display: grid;
  gap: 14px;
  max-width: 620px;
}

.home-workbench h1 {
  max-width: 18ch;
  margin-bottom: 0;
  font-size: 2.15rem;
  line-height: 1.12;
  text-wrap: balance;
}

.home-workbench .lead {
  max-width: 62ch;
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.68;
  text-wrap: pretty;
}

.static-sprite-sample {
  display: block;
  width: 100%;
  height: auto;
  max-width: 500px;
  justify-self: end;
  overflow: hidden;
  border-radius: 8px;
  object-fit: contain;
}

.tool-shell-primary {
  margin-top: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: none;
  padding: 18px;
}

.tool-workspace {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin-inline: 0;
}

.tool-topline,
.tool-shell-primary .tool-header-main {
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.tool-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tool-topline h2 {
  margin-bottom: 4px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.tool-topline p {
  margin-bottom: 0;
  color: var(--muted);
}

.tool-shell-primary h1 {
  max-width: 820px;
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1.15;
}

.tool-shell-primary .lead {
  max-width: 78ch;
  margin-bottom: 0;
  font-size: 1rem;
}

.account-hint {
  max-width: 60ch;
  margin: 2px 0 0;
  color: var(--muted);
  line-height: 1.62;
  text-wrap: pretty;
}

.account-hint a {
  color: var(--text);
  text-underline-offset: 3px;
}

.account-hint a:hover,
.account-hint a:focus-visible {
  color: var(--primary);
}

.dashboard-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 42px auto 64px;
  padding: 0;
}

.dashboard-shell h1 {
  max-width: none;
  margin-bottom: 0;
  font-size: 2.25rem;
  line-height: 1.1;
}

.editor-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 42px auto 64px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.editor-panel {
  margin-bottom: 18px;
}

.editor-shell h1 {
  max-width: none;
  margin-bottom: 4px;
  font-size: 1.75rem;
  line-height: 1.15;
}

.editor-shell .lead {
  max-width: 62ch;
  font-size: 0.98rem;
}

.dashboard-heading,
.editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-heading,
.editor-heading {
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.dashboard-shell .lead {
  max-width: 62ch;
  font-size: 1rem;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.25;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.editor-shell .editor-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.editor-workflow {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.55fr);
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  padding-bottom: 22px;
}

.editor-tabs {
  min-width: 0;
}

.editor-tab-list {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.editor-tab {
  min-width: 96px;
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 10px 16px;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.editor-tab:hover:not(:disabled),
.editor-tab:focus-visible {
  color: var(--primary);
}

.editor-tab[aria-selected="true"] {
  border-bottom-color: var(--primary);
  color: var(--text);
}

.editor-tab:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.45;
}

.editor-tab-panel {
  padding-top: 20px;
}

.editor-tab-panel[hidden] {
  display: none;
}

.sprite-download-intro {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-bottom: 24px;
}

.sprite-download-intro p {
  overflow: visible;
  margin: 0;
  text-overflow: clip;
  white-space: normal;
}

.sprite-usage-example {
  display: grid;
  gap: 12px;
  max-width: 780px;
}

.sprite-usage-example h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.sprite-usage-example p {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.sprite-usage-example pre {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  padding: 16px 76px 16px 16px;
}

.editor-shell .editor-panel-compact {
  border-bottom: 0;
  padding-bottom: 0;
}

.metadata-form {
  display: grid;
  gap: 14px;
  align-items: start;
}

.metadata-form h2 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.metadata-form .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metadata-form .form-grid > label {
  align-self: start;
}

.metadata-form .form-grid > label input:not([type="checkbox"]) {
  height: 42px;
}

.metadata-form .span-2 {
  grid-column: 1 / -1;
}

.metadata-form .button {
  justify-self: start;
}

.editor-shell .dropzone {
  min-height: 100%;
  margin-top: 0;
  padding: 20px;
}

.editor-shell .dropzone strong {
  font-size: 1.05rem;
}

.icons-panel {
  padding-top: 0;
}

.upload-panel {
  display: grid;
  align-content: stretch;
  gap: 12px;
}

.upload-panel .tool-header,
.upload-panel .status-line {
  margin: 0;
}

.upload-panel .status-line:empty {
  display: none;
}

.editor-shell .settings-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.settings-panel .metadata-form .button {
  justify-self: end;
}

.create-sprite-form {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label,
.saved-icon-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.form-grid label small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.form-grid .checkbox-field {
  display: flex;
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  align-self: end;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
}

.form-grid .checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.form-grid input,
.form-grid select,
.saved-icon-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
}

.span-2 {
  grid-column: 1 / -1;
}

.sprite-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.dashboard-shell .sprite-list {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.sprite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.sprite-row-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.sprite-row-preview {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--text);
}

.sprite-row-preview svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.sprite-row-copy {
  min-width: 0;
}

.sprite-row h2 {
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 1.1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sprite-row p,
.editor-panel p {
  overflow: hidden;
  margin-bottom: 0;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.row-actions form {
  margin: 0;
}

.saved-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.saved-icon-card {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px;
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}

.saved-icon-card.is-dirty,
.saved-icon-card:has(.saved-icon-form.is-dirty) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.saved-icon-card .icon-preview {
  width: 100%;
  min-height: 52px;
  padding: 6px;
}

.icon-preview-button {
  appearance: none;
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease-out, background-color 140ms ease-out;
}

.icon-preview-button:hover,
.icon-preview-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.saved-icon-form {
  display: grid;
  gap: 4px;
}

.saved-icon-form .row-actions {
  position: absolute;
  inset: 6px 6px auto auto;
  justify-content: flex-end;
}

.saved-icon-form label {
  gap: 0;
}

.saved-icon-form input {
  font-weight: 500;
}

.icon-delete {
  display: inline-grid;
  width: 28px;
  min-height: 28px;
  place-items: center;
  border-radius: 6px;
  padding: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.65;
}

.icon-delete:hover,
.icon-delete:focus-visible {
  background: var(--panel);
  color: var(--danger);
  opacity: 1;
}

.row-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.row-status:empty {
  display: none;
}

.row-status.is-error {
  color: var(--danger);
}

.detail-badge {
  position: absolute;
  inset: 12px auto auto 12px;
  display: inline-grid;
  width: 22px;
  min-height: 22px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.detail-badge.has-warnings {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--text);
}

.detail-badge:hover,
.detail-badge:focus-visible,
.detail-badge[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary);
}

.icon-popover {
  position: absolute;
  z-index: 20;
  inset: 38px auto auto 8px;
  width: min(260px, 72vw);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
  color: var(--text);
  box-shadow: 0 8px 18px oklch(28% 0.03 276 / 0.14);
  font-size: 0.84rem;
}

.icon-popover ul {
  margin: 6px 0 0;
  padding-left: 17px;
}

.icon-popover li {
  position: relative;
  padding-right: 24px;
}

.icon-popover li + li {
  margin-top: 7px;
}

.message-dismiss {
  position: absolute;
  inset: -2px 0 auto auto;
  display: inline-grid;
  width: 20px;
  min-height: 20px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.message-dismiss:hover,
.message-dismiss:focus-visible {
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-source-dialog {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  background: oklch(22% 0.03 276 / 0.48);
  padding: 24px 16px;
}

.icon-source-dialog[hidden] {
  display: none;
}

.icon-source-dialog-surface {
  width: min(720px, calc(100% - 32px));
  max-height: min(680px, calc(100dvh - 48px));
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 16px;
  color: var(--text);
}

.icon-source-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.icon-dialog-close {
  width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 1.15rem;
}

.icon-source-editor {
  display: block;
  width: 100%;
  min-height: 280px;
  max-height: min(540px, calc(100dvh - 150px));
  overflow: auto;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0;
  background: var(--code-bg);
  padding: 14px;
  color: var(--text);
  font: 0.86rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.icon-source-editor:focus {
  border-color: var(--primary);
  outline: 2px solid color-mix(in oklab, var(--primary) 24%, transparent);
  outline-offset: 1px;
}

.icon-source-dialog-footer {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.icon-source-dialog-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
}

.icon-source-status {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.icon-source-status.is-error {
  color: var(--danger);
}

.icon-grid-footer {
  display: flex;
  justify-content: flex-end;
  min-height: 34px;
  margin-top: 12px;
}

.editor-shell .font-panel {
  display: grid;
  gap: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.font-panel-heading,
.font-ready-row,
.font-error {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.font-panel .font-panel-heading p,
.font-panel .font-meta,
.font-panel .font-usage,
.font-panel .font-empty p,
.font-panel .font-error p {
  overflow: visible;
  margin: 0;
  text-overflow: clip;
  white-space: normal;
}

.font-status {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--panel-muted);
  padding: 4px 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.font-status-ready {
  background: oklch(93% 0.05 151);
  color: var(--success);
}

.font-status-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.font-status-pending {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.font-ready-row {
  align-items: center;
}

.font-cdn-control {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-block: 1px solid var(--border);
  padding-block: 10px;
}

.font-cdn-control label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.font-cdn-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.font-cdn-control-status {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.font-cdn-control-status.is-error {
  color: var(--danger);
}

.font-cdn-content {
  display: grid;
  gap: 12px;
}

.font-cdn-content[hidden] {
  display: none;
}

.font-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.font-downloads .button small {
  opacity: 0.78;
  font-size: 0.75rem;
}

.font-meta {
  font-size: 0.85rem;
}

.font-cdn-block {
  display: grid;
  gap: 12px;
}

.font-cdn-block > p {
  overflow: visible;
  margin: 0;
  color: var(--muted);
  text-overflow: clip;
  white-space: normal;
}

.font-cdn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.cdn-link-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.cdn-link-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.font-usage {
  font-size: 0.9rem;
}

.font-error {
  border-radius: 8px;
  background: var(--danger-soft);
  padding: 13px;
  color: var(--danger);
}

.font-error p {
  color: var(--danger);
  font-size: 0.9rem;
}

.font-problem-icons {
  display: grid;
  gap: 12px;
}

.font-error-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.9rem;
}

.font-error-list li + li {
  margin-top: 5px;
}

.font-empty {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.message-page {
  padding: 70px 0 120px;
}

.message-page h1 {
  max-width: 820px;
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.editor-shell .tool-header h2 {
  margin-bottom: 4px;
  font-size: 1rem;
  line-height: 1.25;
}

.dropzone {
  display: grid;
  min-height: 210px;
  place-items: center;
  gap: 6px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  margin-top: 16px;
  padding: 28px;
  background: var(--panel-raised);
  text-align: center;
  cursor: pointer;
}

.tool-shell-primary .dropzone {
  min-height: 168px;
  margin-top: 0;
  padding: 24px;
}

.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dropzone strong {
  font-size: 1.35rem;
}

.dropzone span,
.dropzone small,
.empty-state p,
.site-footer {
  color: var(--muted);
}

.empty-state {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.dashboard-empty {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.dashboard-empty p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.tool-shell-primary .option-row {
  justify-content: space-between;
  border-top: 0;
  border-bottom: 1px solid var(--border);
  margin-top: 12px;
  padding: 0 0 14px;
}

.tool-shell-primary .empty-state {
  border-top: 0;
  padding-top: 0;
}

.tool-shell-primary .saved-icon-grid {
  margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
}

.tool-shell-primary.has-icons .dropzone {
  min-height: 94px;
  padding: 16px;
}

.tool-shell-primary.has-icons .dropzone strong {
  font-size: 1.08rem;
}

.tool-shell-primary.has-icons .saved-icon-grid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}

.tool-shell-primary.has-icons .icon-preview {
  min-height: 58px;
}

.tool-shell-primary.has-icons .sprite-output {
  margin-top: 16px;
  padding-top: 14px;
}

.empty-state p {
  max-width: 58ch;
  margin-bottom: 0;
}

.status-line {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.status-line.is-error {
  color: var(--danger);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.icon-card {
  display: grid;
  position: relative;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.icon-preview {
  display: grid;
  min-height: 112px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--text);
}

.icon-preview svg {
  width: 52px;
  height: 52px;
  fill: currentColor;
}

.icon-meta {
  display: grid;
  gap: 8px;
}

.icon-meta small {
  color: var(--muted);
}

.symbol-input {
  width: 100%;
  padding: 8px 10px;
}

.warnings {
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  background: var(--warning-bg);
  padding: 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.notes {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-muted);
  padding: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.warnings ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.notes ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.sprite-output {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.code-preview-box {
  position: relative;
}

.copy-inline {
  position: absolute;
  z-index: 1;
  inset: 8px 8px auto auto;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.copy-inline:not(:disabled):hover,
.copy-inline:not(:disabled):focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.copy-inline:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sprite-output pre {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  padding: 14px 72px 14px 14px;
}

.site-footer {
  width: 100%;
  flex-shrink: 0;
  border-top: 1px solid var(--footer-border);
  background: var(--footer-bg);
  color: oklch(84% 0.02 276);
  font-size: 0.92rem;
}

.site-footer-inner {
  display: flex;
  width: min(1120px, calc(100% - 32px));
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-inline: auto;
  padding: 14px 0;
}

.site-footer a {
  color: var(--panel);
  font-weight: 700;
  text-decoration: none;
}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
  vertical-align: -0.2em;
}

.footer-logo {
  display: block;
  width: auto;
  height: 19px;
  margin-left: 2px;
}

.floatingchat-container-wrap {
  position: relative !important;
  inset: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 1 !important;
  width: 180px !important;
  height: 65px !important;
  margin: -70px max(16px, calc((100vw - 1120px) / 2)) 5px auto !important;
  transform: none !important;
}

.floatingchat-container-wrap iframe {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  max-width: 100%;
}

.floating-chat-kofi-popup-iframe {
  position: fixed !important;
  top: auto !important;
  right: var(--kofi-popup-right, max(16px, calc((100vw - 1120px) / 2))) !important;
  bottom: var(--kofi-popup-bottom, calc(env(safe-area-inset-bottom, 0px) + 88px)) !important;
  left: auto !important;
  z-index: 20 !important;
  width: min(328px, calc(100vw - 32px)) !important;
  height: min(690px, var(--kofi-popup-max-height, calc(100dvh - 120px))) !important;
  transition: opacity 160ms ease-out !important;
}

.floating-chat-kofi-popup-iframe[style*="opacity: 0"],
.floating-chat-kofi-popup-iframe[style*="opacity:0"] {
  pointer-events: none !important;
}

.floating-chat-kofi-popup-iframe-container {
  width: 100% !important;
  height: 100% !important;
}

.floating-chat-kofi-popup-iframe iframe[src*="ko-fi.com/boohja/"][src*="embed=true"] {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}

.floatingchat-container-wrap-mobi {
  display: none !important;
}

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

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

@media (max-width: 780px) {
  .site-header,
  .site-footer-inner,
  .tool-header,
  .intro-panel,
  .hero {
    align-items: stretch;
  }

  .site-header,
  .site-footer-inner,
  .tool-header {
    flex-direction: column;
  }

  .dashboard-heading,
  .editor-heading,
  .sprite-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-grid,
  .saved-icon-form {
    grid-template-columns: 1fr;
  }

  .editor-workflow,
  .metadata-form .form-grid {
    grid-template-columns: 1fr;
  }

  .saved-icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .home-workbench {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 12px;
    margin-bottom: 42px;
  }

  .home-workbench h1 {
    max-width: 18ch;
    font-size: 1.85rem;
  }

  .home-workbench .lead {
    max-width: 68ch;
  }

  .static-sprite-sample {
    max-width: 420px;
    justify-self: start;
  }

  .tool-shell-primary {
    padding: 14px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  .intro-panel {
    grid-template-columns: 1fr;
  }

  .site-nav,
  .tool-actions,
  .option-row,
  .button {
    width: 100%;
  }

  .editor-heading .tool-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .font-panel-heading,
  .font-ready-row,
  .font-error {
    flex-direction: column;
  }

  .font-cdn-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .font-downloads,
  .font-downloads .button,
  .font-cdn-row .button {
    width: 100%;
  }

  .icon-source-dialog-footer,
  .icon-source-dialog-actions {
    width: 100%;
  }

  .icon-source-dialog-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-tab-list {
    overflow-x: auto;
  }

  .editor-tab {
    min-width: 92px;
    flex: 1 0 auto;
  }

  .sprite-download-intro .button {
    width: 100%;
  }

  .editor-heading .tool-actions .inline-form,
  .editor-heading .tool-actions .button {
    width: 100%;
  }

  .preview-panel pre {
    min-height: 220px;
  }
}
