  :root {
    --bg-primary: #0a0a0c;
    --bg-secondary: #111114;
    --bg-elevated: #18181c;
    --bg-surface: #1e1e24;
    --bg-surface-hover: #25252d;

    --border-subtle: #2a2a32;
    --border-medium: #3a3a44;
    --border-accent: #e8572850;

    --text-primary: #e8e8ec;
    --text-secondary: #9898a4;
    --text-tertiary: #68687a;
    --text-inverse: #0a0a0c;

    --accent: #e85728;
    --accent-hover: #ff6b3d;
    --accent-muted: #e8572820;
    --accent-subtle: #e8572810;

    --success: #34d399;
    --success-muted: #34d39920;
    --warning: #fbbf24;
    --warning-muted: #fbbf2420;
    --error: #f87171;
    --error-muted: #f8717120;
    --info: #60a5fa;
    --info-muted: #60a5fa20;

    --font-body: 'Instrument Sans', system-ui, sans-serif;
    --font-mono: 'DM Mono', 'SF Mono', 'Fira Code', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(232, 87, 40, 0.15);
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    background: var(--bg-primary);
    color: var(--text-primary);
    scrollbar-color: var(--border-medium) var(--bg-primary);
  }

  body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  code, pre, kbd {
    font-family: var(--font-mono);
  }

  a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
  }

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

  ::selection {
    background: var(--accent);
    color: var(--text-inverse);
  }

  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: var(--bg-primary);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
  }

  .page {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    min-height: 100vh;
    position: relative;
  }

  .grain {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
  }

  .page > * {
    position: relative;
    z-index: 1;
  }

  /* Hero */
  .hero {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-subtle);
  }

  .hero__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--accent);
    background: var(--accent-muted);
    border: 1px solid var(--border-accent);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
  }

  .hero__title {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
  }

  .hero__title-line {
    display: block;
    color: var(--text-primary);
  }

  .hero__title-accent {
    display: block;
    color: var(--accent);
  }

  .hero__sub {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 600px;
  }

  /* Nav Cards */
  .nav-cards {
    display: grid;
    gap: 1rem;
    margin-bottom: 3rem;
  }

  .nav-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
  }

  .nav-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    color: var(--text-primary);
    transform: translateY(-1px);
  }

  .nav-card--primary {
    border-color: var(--border-accent);
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--accent-subtle) 100%);
  }

  .nav-card__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-muted);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    color: var(--accent);
  }

  .nav-card__content {
    flex: 1;
  }

  .nav-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
  }

  .nav-card__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
  }

  .nav-card__arrow {
    font-size: 1.5rem;
    color: var(--text-tertiary);
    transition: transform 0.2s, color 0.2s;
  }

  .nav-card:hover .nav-card__arrow {
    transform: translateX(4px);
    color: var(--accent);
  }

  /* Info Grid */
  .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 3rem;
  }

  @media (max-width: 700px) {
    .info-grid {
      grid-template-columns: 1fr;
    }
    .hero__title {
      font-size: 2.2rem;
    }
  }

  .info-block {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
  }

  .info-block__title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
  }

  /* Tags */
  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 400;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    border: 1px solid;
  }

  .tag--raster {
    color: var(--success);
    border-color: var(--success-muted);
    background: var(--success-muted);
  }

  .tag--vector {
    color: var(--info);
    border-color: var(--info-muted);
    background: var(--info-muted);
  }

  .tag--doc {
    color: var(--warning);
    border-color: var(--warning-muted);
    background: var(--warning-muted);
  }

  /* Preset Table */
  .preset-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .preset-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.6rem;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
  }

  .preset-row__name {
    color: var(--accent);
    font-size: 0.75rem;
    min-width: 100px;
  }

  .preset-row__detail {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
  }

  /* Endpoints */
  .endpoint-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .endpoint {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
  }

  .endpoint__method {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
  }

  .endpoint__method--get {
    color: var(--success);
    background: var(--success-muted);
  }

  .endpoint__method--post {
    color: var(--warning);
    background: var(--warning-muted);
  }

  .endpoint__path {
    color: var(--text-secondary);
    font-size: 0.72rem;
    word-break: break-all;
  }

  /* Feature list */
  .feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .feature-list li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding-left: 1.1rem;
    position: relative;
  }

  .feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
  }

  /* Footer */
  .footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
  }

  .footer__text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
  }

  /* ================================================================= */
  /* PAGE LAYOUT                                                       */
  /* ================================================================= */
  .page {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
    min-height: 100vh;
    position: relative;
  }

  .grain {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
  }

  .page > * {
    position: relative;
    z-index: 1;
  }

  /* ================================================================= */
  /* TOPBAR                                                            */
  /* ================================================================= */
  .topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
  }

  .topbar__back {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    transition: color 0.15s;
  }

  .topbar__back:hover {
    color: var(--accent);
  }

  .topbar__title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
  }

  .topbar__badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
  }

  .topbar__badge--working {
    color: var(--warning);
    background: var(--warning-muted);
    border-color: var(--warning);
    animation: pulse 1.5s infinite;
  }

  .topbar__badge--done {
    color: var(--success);
    background: var(--success-muted);
    border-color: var(--success);
  }

  .topbar__badge--error {
    color: var(--error);
    background: var(--error-muted);
    border-color: var(--error);
  }

  @keyframes pulse {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.6;
    }
  }

  /* ================================================================= */
  /* PANELS                                                            */
  /* ================================================================= */
  .panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
  }

  .panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
  }

  .panel__title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
  }

  /* ================================================================= */
  /* DROP ZONE                                                         */
  /* ================================================================= */
  .drop-zone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    margin-bottom: 1rem;
  }

  .drop-zone:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
  }

  .drop-zone--active {
    border-color: var(--accent);
    background: var(--accent-muted);
    box-shadow: var(--shadow-glow);
  }

  .drop-zone--has-file {
    border-color: var(--success);
    border-style: solid;
    background: var(--success-muted);
  }

  .drop-zone--has-file:hover {
    border-color: var(--success);
    background: var(--success-muted);
  }

  .drop-zone__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .drop-zone__icon {
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
  }

  .drop-zone--active .drop-zone__icon {
    color: var(--accent);
  }

  .drop-zone__text {
    font-size: 0.9rem;
    color: var(--text-secondary);
  }

  .drop-zone__browse {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .drop-zone__hint {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
  }

  .drop-zone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
  }

  /* ================================================================= */
  /* FORM ELEMENTS                                                     */
  /* ================================================================= */
  .upload-form__row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
  }

  .field {
    flex: 1;
  }

  .field--inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .field__label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.4rem;
  }

  .field--inline .field__label {
    margin-bottom: 0;
    white-space: nowrap;
  }

  .field__value {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.6rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .field__value code {
    color: var(--text-primary);
    font-size: 0.8rem;
  }

  .file-size {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
  }

  .input {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    outline: none;
    transition: border-color 0.15s;
  }

  .input:focus {
    border-color: var(--accent);
  }

  .input::placeholder {
    color: var(--text-tertiary);
  }

  /* ================================================================= */
  /* BUTTONS                                                           */
  /* ================================================================= */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }

  .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .btn--primary {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
  }

  .btn--primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
  }

  .btn--secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-medium);
  }

  .btn--secondary:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
  }

  .btn--ghost {
    background: transparent;
    color: var(--text-tertiary);
    border-color: transparent;
    padding: 0.35rem 0.7rem;
  }

  .btn--ghost:hover {
    color: var(--accent);
  }

  .btn--sm {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
  }

  .btn__spinner {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
  }

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

  /* ================================================================= */
  /* PRESET CONTROLS                                                   */
  /* ================================================================= */
  .preset-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
  }

  .preset-control {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: opacity 0.2s;
  }

  .preset-control--disabled {
    opacity: 0.35;
    pointer-events: none;
  }

  .preset-control--disabled .preset-control__header {
    pointer-events: auto;
  }

  .preset-control__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
  }

  .preset-control__name {
    font-size: 0.8rem;
    color: var(--accent);
  }

  .preset-control__fields {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  /* Toggle switch */
  .toggle {
    position: relative;
    cursor: pointer;
  }

  .toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
  }

  .toggle__track {
    display: block;
    width: 32px;
    height: 18px;
    background: var(--border-medium);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
  }

  .toggle__track::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--text-primary);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
  }

  .toggle input:checked + .toggle__track {
    background: var(--accent);
  }

  .toggle input:checked + .toggle__track::after {
    transform: translateX(14px);
  }

  /* Slider field */
  .slider-field {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.15rem 0.75rem;
    align-items: center;
  }

  .slider-field__label {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    grid-column: 1;
    letter-spacing: 0.03em;
  }

  .slider-field__value {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-secondary);
    grid-column: 2;
    grid-row: 1 / 3;
    min-width: 50px;
    text-align: right;
  }

  .slider-field__input {
    grid-column: 1;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-medium);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
  }

  .slider-field__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-surface);
  }

  .slider-field__input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-surface);
  }

  /* ================================================================= */
  /* LOAD ROW                                                          */
  /* ================================================================= */
  .load-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .load-row .field--inline {
    flex: 1;
  }

  .load-row .input {
    min-width: 200px;
  }

  /* ================================================================= */
  /* RESULTS                                                           */
  /* ================================================================= */
  .results-panel {
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .result-meta {
    display: flex;
    gap: 0.5rem;
  }

  .chip {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
  }

  .chip--kind {
    color: var(--info);
    border-color: var(--info-muted);
    background: var(--info-muted);
  }

  .chip--error {
    color: var(--error);
    border-color: var(--error-muted);
    background: var(--error-muted);
  }

  /* Original info card */
  .orig-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    overflow: hidden;
  }

  .orig-card__preview {
    flex: 0 0 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      linear-gradient(45deg, var(--bg-elevated) 25%, transparent 25%),
      linear-gradient(-45deg, var(--bg-elevated) 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, var(--bg-elevated) 75%),
      linear-gradient(-45deg, transparent 75%, var(--bg-elevated) 75%);
    background-size: 12px 12px;
    background-position:
      0 0,
      0 6px,
      6px -6px,
      -6px 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .orig-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .orig-card__placeholder {
    font-size: 0.75rem;
    color: var(--text-tertiary);
  }

  .orig-card__details {
    flex: 1;
    min-width: 0;
  }

  .orig-card__filename {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    word-break: break-all;
  }

  .orig-card__meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.75rem;
  }

  .meta-pair {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.78rem;
  }

  .meta-pair--full {
    grid-column: 1 / -1;
  }

  .meta-pair__label {
    color: var(--text-tertiary);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
  }

  .meta-pair__value {
    color: var(--text-secondary);
    font-size: 0.75rem;
  }

  .meta-pair__value--truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    display: inline-block;
    vertical-align: bottom;
  }

  .orig-card__download {
    margin-top: 0.25rem;
  }

  /* ================================================================= */
  /* PREVIEW GRID                                                      */
  /* ================================================================= */
  .preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.25rem;
  }
  .preview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition:
      border-color 0.2s,
      box-shadow 0.2s;
  }

  .preview-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
  }

  .preview-card__img-wrap {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background:
      linear-gradient(45deg, var(--bg-elevated) 25%, transparent 25%),
      linear-gradient(-45deg, var(--bg-elevated) 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, var(--bg-elevated) 75%),
      linear-gradient(-45deg, transparent 75%, var(--bg-elevated) 75%);
    background-size: 12px 12px;
    background-position:
      0 0,
      0 6px,
      6px -6px,
      -6px 0;
    overflow: hidden;
  }

  .preview-card__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
  }

  .preview-card__no-preview {
    font-size: 0.75rem;
    color: var(--text-tertiary);
  }

  .preview-card__info {
    padding: 0.85rem;
  }

  .preview-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
  }

  .preview-card__name {
    font-size: 0.8rem;
    color: var(--accent);
  }

  .preview-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
  }

  .preview-card__link {
    font-size: 0.72rem;
    font-weight: 600;
  }

  /* ================================================================= */
  /* JSON OUTPUT                                                       */
  /* ================================================================= */
  .json-details {
    margin-top: 0.5rem;
  }

  .json-details__summary {
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    padding: 0.5rem 0;
    transition: color 0.15s;
  }

  .json-details__summary:hover {
    color: var(--accent);
  }

  .json-output {
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.72rem;
    color: var(--text-secondary);
    overflow: auto;
    max-height: 500px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
  }

  /* ================================================================= */
  /* ERROR                                                             */
  /* ================================================================= */
  .error-banner {
    padding: 1rem;
    background: var(--error-muted);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  /* ================================================================= */
  /* FOOTER                                                            */
  /* ================================================================= */
  .footer {
    padding-top: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
  }

  .footer__text {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
  }

  /* ================================================================= */
  /* RESPONSIVE                                                        */
  /* ================================================================= */
  @media (max-width: 700px) {
    .page {
      padding: 0 1rem 2rem;
    }

    .upload-form__row {
      flex-direction: column;
      align-items: stretch;
    }

    .load-row {
      flex-wrap: wrap;
    }

    .orig-card {
      flex-direction: column;
    }

    .orig-card__preview {
      flex: 0 0 auto;
      width: 100%;
    }

    .preset-controls {
      grid-template-columns: 1fr;
    }
  }

/* ================================================================= */
/* PAGE-SPECIFIC OVERRIDES AFTER GLOBAL EXTRACTION                   */
/* ================================================================= */
.home-page.page {
  max-width: 960px;
  padding: 3rem 2rem 2rem;
}

.home-page .footer {
  padding-top: 1.5rem;
  margin-top: 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.home-page .footer__text {
  font-size: 0.7rem;
}

.playground-page.page {
  max-width: 1060px;
  padding: 0 2rem 3rem;
}

.assets-page.page {
  max-width: 1240px;
  padding: 0 2rem 3rem;
}

/* ================================================================= */
/* ASSET LISTING PAGE                                                 */
/* ================================================================= */
.assets-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}

.assets-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.assets-empty {
  padding: 1.25rem;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.asset-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.asset-card__preview {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(45deg, var(--bg-elevated) 25%, transparent 25%),
    linear-gradient(-45deg, var(--bg-elevated) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--bg-elevated) 75%),
    linear-gradient(-45deg, transparent 75%, var(--bg-elevated) 75%);
  background-size: 12px 12px;
  background-position:
    0 0,
    0 6px,
    6px -6px,
    -6px 0;
  padding: 0.75rem;
}

.asset-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.asset-card__body {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.asset-card__title {
  font-size: 0.82rem;
  color: var(--accent);
  word-break: break-all;
}

.asset-card__filename {
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-word;
}

.asset-card__meta {
  display: grid;
  gap: 0.25rem;
}

.asset-card__meta-row {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.asset-card__meta-label {
  font-size: 0.64rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.asset-card__meta-value {
  font-size: 0.74rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.asset-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.asset-card__link {
  font-size: 0.74rem;
  font-weight: 600;
}

@media (max-width: 700px) {
  .home-page.page {
    padding: 3rem 1rem 2rem;
  }

  .playground-page.page,
  .assets-page.page {
    padding: 0 1rem 2rem;
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }
}
