.tn-px-page {
  --px-paper: #faf6ee;
  --px-wash: #f5efdf;
  --px-ink: #1a1208;
  --px-muted: #5a4a30;
  --px-line: #b8a888;
  --px-button: #ede6d4;
  --px-button-text: #1a1208;
  --px-hover: #dfd4bb;
  --px-action: #1a1208;
  --px-action-hover: #873600;
  --px-action-text: #f7ead1;
  --px-focus: #a83d00;
  --px-sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif;
  --px-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  width: 100%; min-width: 0; max-width: 100%;
  color: var(--px-ink); -webkit-text-fill-color: var(--px-ink);
}
body:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-d="dark"], [data-scheme="auto"][data-l="dark"]) .tn-px-page,
html:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-d="dark"], [data-scheme="auto"][data-l="dark"]) body:not([data-scheme="light"]) .tn-px-page {
  --px-paper: #241d12; --px-wash: #322a1a; --px-ink: #efe6d2;
  --px-muted: #c3b492; --px-line: #826744; --px-button: #2f2115;
  --px-button-text: #f7ead1; --px-hover: #3a2a1b;
  --px-action: #6a3b1f; --px-action-hover: #824826;
  --px-action-text: #f7ead1; --px-focus: #e8823f;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  body[data-scheme="auto"] .tn-px-page,
  html[data-scheme="auto"] body:not([data-scheme="light"]) .tn-px-page {
    --px-paper: #241d12; --px-wash: #322a1a; --px-ink: #efe6d2;
    --px-muted: #c3b492; --px-line: #826744; --px-button: #2f2115;
    --px-button-text: #f7ead1; --px-hover: #3a2a1b;
    --px-action: #6a3b1f; --px-action-hover: #824826;
    --px-action-text: #f7ead1; --px-focus: #e8823f;
    color-scheme: dark;
  }
}
.tn-px-page [hidden], #tnPixelStage [hidden] { display: none !important; }
.tn-px-page .tn-px-tool { width: 100%; min-width: 0; margin: 0; font: 14px/1.6 var(--px-sans); color: var(--px-ink); -webkit-text-fill-color: var(--px-ink); }
.tn-px-tool, .tn-px-tool *, .tn-px-tool *::before, .tn-px-tool *::after { box-sizing: border-box; }
.tn-px-tool :is(p,h2) { margin: 0; padding: 0; }
.tn-px-tool .tn-px-workspace { display: grid; grid-template-columns: 275px minmax(0,1fr); min-width: 0; border: 1px solid var(--px-line); background: var(--px-paper); }
.tn-px-tool .tn-px-settings { display: grid; align-content: start; gap: 10px; padding: 14px; min-width: 0; border-right: 1px solid var(--px-line); }
.tn-px-tool .tn-px-preview-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; }
.tn-px-tool .tn-px-section-label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.tn-px-tool .tn-px-section-label > span:first-child { font: 800 12px/1.5 var(--px-sans); font-variant-numeric: lining-nums tabular-nums; color: var(--px-muted); -webkit-text-fill-color: var(--px-muted); }
.tn-px-tool .tn-px-section-label h2 { font: 700 14px/1.5 var(--px-sans); color: var(--px-ink); -webkit-text-fill-color: var(--px-ink); }
.tn-px-tool .tn-px-manual { margin-left: auto; font-size: 11px; color: var(--px-muted); -webkit-text-fill-color: var(--px-muted); }
.tn-px-tool .tn-px-palette { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.tn-px-tool button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; min-height: 38px; max-width: 100%; margin: 0; padding: 0 10px;
  appearance: none; -webkit-appearance: none; border: 1px solid var(--px-line); border-radius: 0;
  background: var(--px-button); color: var(--px-button-text); -webkit-text-fill-color: var(--px-button-text);
  font: 700 13px/1 var(--px-mono); letter-spacing: normal; text-transform: none;
  box-shadow: none; outline: none; cursor: pointer;
}
.tn-px-tool button:is(:hover,:focus-visible):not(:disabled) { background: var(--px-hover); }
.tn-px-tool button:focus-visible { outline: 2px solid var(--px-focus); outline-offset: 2px; }
.tn-px-tool button:disabled { opacity: .65; cursor: not-allowed; }
.tn-px-tool .tn-px-color { justify-content: flex-start; padding-inline: 8px; gap: 6px; }
.tn-px-tool .tn-px-color[aria-pressed="true"] { border: 2px solid var(--px-focus); padding-inline: 7px; background: var(--px-wash); }
.tn-px-tool .tn-px-swatch { display: block; flex: 0 0 14px; width: 14px; height: 14px; border: 1px solid #888; background: var(--px-swatch) !important; forced-color-adjust: none; }
.tn-px-tool .tn-px-selected { margin-left: auto; font: 600 10px/1 var(--px-sans); visibility: hidden; }
.tn-px-tool .tn-px-color[aria-pressed="true"] .tn-px-selected { visibility: visible; }
.tn-px-tool #tnPixelStart { width: 100%; margin-top: 4px; background: var(--px-action); border-color: var(--px-action); color: var(--px-action-text); -webkit-text-fill-color: var(--px-action-text); }
.tn-px-tool #tnPixelStart:is(:hover,:focus-visible):not(:disabled) { background: var(--px-action-hover); }
.tn-px-tool :is(.tn-px-hint,.tn-px-limit) { font-size: 12px; line-height: 1.7; color: var(--px-muted); -webkit-text-fill-color: var(--px-muted); overflow-wrap: anywhere; }
.tn-px-tool .tn-px-limit { margin-top: 12px; }
.tn-px-tool .tn-px-limit strong { font-weight: 700; }
.tn-px-tool .tn-px-preview { width: 100%; min-height: 220px; flex: 1 0 auto; aspect-ratio: 16 / 9; }
.tn-px-tool #tnPixelPreview, #tnPixelSurface {
  background: var(--px-test-color,#000000) !important; background-image: none !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; outline: none !important;
  opacity: 1 !important; filter: none !important; mix-blend-mode: normal !important;
  animation: none !important; transition: none !important; forced-color-adjust: none; color-scheme: only light;
}
.tn-px-tool #tnPixelPreview::before, .tn-px-tool #tnPixelPreview::after,
#tnPixelSurface::before, #tnPixelSurface::after { content: none !important; display: none !important; }
.tn-px-tool .tn-px-color-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; border-bottom: 1px solid var(--px-line); padding-bottom: 10px; }
.tn-px-tool .tn-px-color-meta strong { font: 800 20px/1.4 var(--px-sans); }
.tn-px-tool .tn-px-color-meta code { padding: 0; border: 0; background: transparent; color: var(--px-muted); -webkit-text-fill-color: var(--px-muted); font: 13px/1.5 var(--px-mono); }
.tn-px-tool .tn-px-color-meta > span { margin-left: auto; color: var(--px-muted); -webkit-text-fill-color: var(--px-muted); font: 600 12px/1.5 var(--px-sans); font-variant-numeric: lining-nums tabular-nums; }
.tn-px-tool .tn-px-observation { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.tn-px-tool .tn-px-status { min-height: 22px; padding-top: 10px; border-top: 1px solid var(--px-line); font-size: 12px; line-height: 1.7; color: var(--px-muted); -webkit-text-fill-color: var(--px-muted); overflow-wrap: anywhere; }
.tn-px-tool .tn-px-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 11px; color: var(--px-muted); -webkit-text-fill-color: var(--px-muted); }
.tn-px-tool .tn-px-shortcuts > span { display: inline-flex; align-items: center; gap: 4px; }
.tn-px-tool kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; margin: 0; padding: 0 4px; border: 1px solid var(--px-line); border-radius: 0; box-shadow: none; background: var(--px-wash); color: var(--px-ink); -webkit-text-fill-color: var(--px-ink); font: 600 11px/1 var(--px-mono); }
.tn-px-page .tn-px-ad { width: 100%; max-width: 900px; min-height: 90px; height: auto; max-height: none; margin: 24px auto; border: 0; background: transparent; overflow: visible; }
.tn-px-page .tn-px-ad--top { margin-top: 0; }
#tnPixelStage {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; box-shadow: none;
  background: var(--px-test-color,#000000) !important; color-scheme: only light;
  animation: none !important; transition: none !important; overscroll-behavior: none;
}
#tnPixelStage:not([open]) { display: none !important; }
#tnPixelStage[open] { display: block; }
#tnPixelStage::backdrop { background: #000; }
#tnPixelScreen, #tnPixelScreen:fullscreen {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden;
  background: var(--px-test-color,#000000) !important; box-shadow: none; color-scheme: only light;
  animation: none !important; transition: none !important;
}
#tnPixelSurface { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#tnPixelStage[data-controls="hidden"], #tnPixelStage[data-controls="hidden"] * { cursor: none !important; }
#tnPixelControls {
  position: absolute; z-index: 1; left: max(14px,env(safe-area-inset-left)); right: max(14px,env(safe-area-inset-right)); bottom: max(14px,env(safe-area-inset-bottom));
  display: grid; gap: 10px; width: auto; max-width: 660px; max-height: calc(100% - 28px); margin: 0 auto; padding: 14px; overflow: auto;
  border: 1px solid #b8a888; border-radius: 0; background: #241d12; color: #efe6d2; -webkit-text-fill-color: #efe6d2;
  font: 13px/1.6 -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif;
  box-shadow: none; text-align: left; color-scheme: dark;
}
#tnPixelControls :is(p,strong) { margin: 0; padding: 0; color: #efe6d2; -webkit-text-fill-color: #efe6d2; }
#tnPixelControls .tn-px-stage-info { display: grid; gap: 3px; }
#tnPixelControls .tn-px-stage-info strong { font-size: 15px; font-weight: 700; }
#tnPixelControls :is(#tnPixelMode,.tn-px-stage-hint) { font-size: 12px; line-height: 1.65; color: #c3b492; -webkit-text-fill-color: #c3b492; overflow-wrap: anywhere; }
#tnPixelControls .tn-px-stage-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
#tnPixelControls button { height: 38px; min-height: 38px; padding: 0 8px; border: 1px solid #826744; background: #2f2115; color: #f7ead1; -webkit-text-fill-color: #f7ead1; }
#tnPixelControls button:is(:hover,:focus-visible) { background: #3a2a1b; }
#tnPixelControls button:focus-visible { outline: 2px solid #e8823f; outline-offset: 2px; }
#tnPixelControls #tnPixelClose { border-color: #b8a888; background: #6a3b1f; }
#tnPixelControls #tnPixelClose:is(:hover,:focus-visible) { background: #824826; }
@media (max-width: 760px) {
  .tn-px-tool .tn-px-workspace { grid-template-columns: minmax(0,1fr); }
  .tn-px-tool .tn-px-settings { border-right: 0; border-bottom: 1px solid var(--px-line); }
  .tn-px-tool .tn-px-preview { min-height: 0; flex: 0 0 auto; }
}
@media (max-width: 420px) {
  #tnPixelControls .tn-px-stage-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #tnPixelControls { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .tn-px-tool, .tn-px-tool *, .tn-px-tool *::before, .tn-px-tool *::after { animation: none; transition: none; scroll-behavior: auto; }
}
