.tn-tb-page,
.tn-tb-tool {
  --tb-paper: #faf6ee;
  --tb-wash: #f5efdf;
  --tb-ink: #1a1208;
  --tb-muted: #5a4a30;
  --tb-line: #b8a888;
  --tb-soft: #ddd4be;
  --tb-button: #ede6d4;
  --tb-button-text: #1a1208;
  --tb-action-line: #b8a888;
  --tb-hover: #dfd4bb;
  --tb-primary: #1a1208;
  --tb-primary-hover: #873600;
  --tb-primary-text: #f7ead1;
  --tb-focus: #a83d00;
  --tb-sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif;
  --tb-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--tb-ink);
  -webkit-text-fill-color: var(--tb-ink);
  min-width: 0;
  max-width: 100%;
}
body:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-d="dark"], [data-scheme="auto"][data-l="dark"]) :is(.tn-tb-page, .tn-tb-tool),
html[data-scheme="dark"] body:not([data-scheme="light"]) :is(.tn-tb-page, .tn-tb-tool) {
  --tb-paper: #241d12;
  --tb-wash: #322a1a;
  --tb-ink: #efe6d2;
  --tb-muted: #c3b492;
  --tb-line: #6f6047;
  --tb-soft: #574a37;
  --tb-button: #2f2115;
  --tb-button-text: #f7ead1;
  --tb-action-line: #826744;
  --tb-hover: #3a2a1b;
  --tb-primary: #6a3b1f;
  --tb-primary-hover: #824826;
  --tb-primary-text: #f7ead1;
  --tb-focus: #e8823f;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  body[data-scheme="auto"] :is(.tn-tb-page, .tn-tb-tool) {
    --tb-paper: #241d12;
    --tb-wash: #322a1a;
    --tb-ink: #efe6d2;
    --tb-muted: #c3b492;
    --tb-line: #6f6047;
    --tb-soft: #574a37;
    --tb-button: #2f2115;
    --tb-button-text: #f7ead1;
    --tb-action-line: #826744;
    --tb-hover: #3a2a1b;
    --tb-primary: #6a3b1f;
    --tb-primary-hover: #824826;
    --tb-primary-text: #f7ead1;
    --tb-focus: #e8823f;
    color-scheme: dark;
  }
}
.tn-tb-tool,
.tn-tb-tool *,
.tn-tb-tool *::before,
.tn-tb-tool *::after { box-sizing: border-box; }
.tn-tb-tool {
  width: 100%;
  margin: 0;
  font-family: var(--tb-sans);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.tn-tb-tool [hidden] { display: none !important; }
.tn-tb-tool :is(form, h2, h3, h4, p, label) { margin: 0; padding: 0; }
.tn-tb-tool :is(h2, h3, h4) { color: var(--tb-ink); -webkit-text-fill-color: var(--tb-ink); font-family: var(--tb-sans); letter-spacing: normal; }
.tn-tb-tool .tn-tb-setup {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(240px, 1fr);
  gap: 24px 28px;
  padding: 24px;
  border: 1px solid var(--tb-line);
  border-top: 3px double var(--tb-line);
  background: var(--tb-paper);
}
.tn-tb-tool .tn-tb-settings { display: grid; gap: 18px; align-content: start; min-width: 0; padding-left: 24px; border-left: 1px solid var(--tb-soft); }
.tn-tb-tool .tn-tb-field { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.tn-tb-tool label { display: block; color: var(--tb-ink); -webkit-text-fill-color: var(--tb-ink); font-size: 13px; font-weight: 700; line-height: 1.5; }
.tn-tb-tool .tn-tb-entry-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.tn-tb-tool .tn-tb-entry-heading label,
.tn-tb-tool .tn-tb-settings-heading { font-size: 16px; font-weight: 700; line-height: 24px; }
.tn-tb-tool .tn-tb-step { margin-right: 8px; color: var(--tb-muted); -webkit-text-fill-color: var(--tb-muted); font-family: var(--tb-sans); font-size: 12px; font-weight: 600; }
.tn-tb-tool .tn-tb-count { font-size: 12px; color: var(--tb-muted); -webkit-text-fill-color: var(--tb-muted); }
.tn-tb-tool .tn-tb-optional { margin-left: 5px; color: var(--tb-muted); -webkit-text-fill-color: var(--tb-muted); font-size: 12px; font-weight: 400; }
.tn-tb-tool :is(input[type="text"], textarea, select) {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0 10px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--tb-line);
  border-radius: 0;
  background: var(--tb-paper);
  color: var(--tb-ink);
  -webkit-text-fill-color: var(--tb-ink);
  font-family: var(--tb-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: normal;
  box-shadow: none;
}
.tn-tb-tool textarea { height: auto; min-height: 180px; padding: 12px; line-height: 1.6; resize: vertical; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; }
.tn-tb-tool #tnTbNames {
  min-height: 220px;
  height: 220px;
  padding: 10px 18px;
  line-height: 24px;
  background-color: var(--tb-wash);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 23px, var(--tb-soft) 23px, var(--tb-soft) 24px);
  background-position: 0 10px;
  background-attachment: local;
}
.tn-tb-tool select { cursor: pointer; background-color: var(--tb-wash); padding-right: 30px; }
.tn-tb-tool select option { color: var(--tb-ink); background: var(--tb-paper); }
.tn-tb-tool :is(input, textarea)::placeholder { color: var(--tb-muted); -webkit-text-fill-color: var(--tb-muted); opacity: .35; font-family: var(--tb-sans); font-weight: 400; }
.tn-tb-tool :is(input, textarea, select)[aria-invalid="true"] { border-color: var(--tb-focus); }
.tn-tb-tool .tn-tb-help,
.tn-tb-tool .tn-tb-match-status { color: var(--tb-muted); -webkit-text-fill-color: var(--tb-muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.tn-tb-tool .tn-tb-error { color: var(--tb-focus); -webkit-text-fill-color: var(--tb-focus); font-size: 13px; font-weight: 600; line-height: 1.6; }
.tn-tb-tool .tn-tb-error:empty { display: none; }
.tn-tb-tool .tn-tb-create-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 18px; border-top: 1px solid var(--tb-soft); }
.tn-tb-tool .tn-tb-create-row :is(#tnTbError, #tnTbDirty) { flex-basis: 100%; }
.tn-tb-tool .tn-tb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.tn-tb-tool button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-height: 40px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--tb-action-line);
  border-radius: 0;
  background: var(--tb-button);
  color: var(--tb-button-text);
  -webkit-text-fill-color: var(--tb-button-text);
  font-family: var(--tb-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  box-shadow: none;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
}
.tn-tb-tool button:hover:not(:disabled) { background: var(--tb-hover); color: var(--tb-button-text); -webkit-text-fill-color: var(--tb-button-text); }
.tn-tb-tool button.tn-tb-primary,
.tn-tb-tool .tn-tb-view-buttons button[aria-pressed="true"] { background: var(--tb-primary); border-color: var(--tb-primary); color: var(--tb-primary-text); -webkit-text-fill-color: var(--tb-primary-text); }
.tn-tb-tool button.tn-tb-primary:is(:hover, :focus-visible):not(:disabled),
.tn-tb-tool .tn-tb-view-buttons button[aria-pressed="true"]:hover { background: var(--tb-primary-hover); border-color: var(--tb-primary-hover); color: var(--tb-primary-text); -webkit-text-fill-color: var(--tb-primary-text); }
.tn-tb-tool #tnTbGenerate { height: 44px; min-height: 44px; padding-inline: 24px; }
.tn-tb-tool .tn-tb-create-row button { height: 44px; min-height: 44px; }
.tn-tb-tool :is(button, input, textarea, select, [tabindex]):focus-visible { outline: 2px solid var(--tb-focus); outline-offset: 2px; }
.tn-tb-tool button:disabled,
.tn-tb-tool button[aria-disabled="true"] { opacity: .7; cursor: not-allowed; }
.tn-tb-tool .tn-tb-output { margin-top: 26px; border: 1px solid var(--tb-line); border-top: 3px double var(--tb-line); padding: 20px; background: var(--tb-paper); min-width: 0; }
.tn-tb-tool .tn-tb-output-head { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; justify-content: space-between; padding-bottom: 12px; }
.tn-tb-tool .tn-tb-output-head h2 { font-size: 20px; font-weight: 700; line-height: 1.5; }
.tn-tb-tool .tn-tb-champion { border-block: 1px solid var(--tb-line); padding: 10px 0; margin-bottom: 12px; color: var(--tb-ink); -webkit-text-fill-color: var(--tb-ink); font-size: 18px; font-weight: 800; }
.tn-tb-tool .tn-tb-view-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 16px 0 8px; }
.tn-tb-tool .tn-tb-view-buttons { gap: 0; }
.tn-tb-tool .tn-tb-view-buttons button + button { margin-left: -1px; }
.tn-tb-tool .tn-tb-zoom { gap: 6px; }
.tn-tb-tool .tn-tb-zoom output { min-width: 44px; text-align: center; font-size: 13px; }
.tn-tb-tool :is(#tnTbZoomOut, #tnTbZoomIn) { width: 40px; font-size: 18px; }
.tn-tb-tool .tn-tb-round-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
.tn-tb-tool .tn-tb-round-nav button { flex: 0 0 auto; height: 32px; min-height: 32px; background: transparent; }
.tn-tb-tool .tn-tb-round-nav button[aria-current="step"] { border-color: var(--tb-focus); text-decoration: underline; text-underline-offset: 4px; }
.tn-tb-tool .tn-tb-bracket {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 860px;
  margin-block: 12px;
  padding: 2px;
  border: 1px solid var(--tb-soft);
  background: var(--tb-wash);
  overflow: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}
.tn-tb-tool .tn-tb-canvas { position: relative; margin-inline: auto; overflow: clip; }
.tn-tb-tool .tn-tb-stage { position: absolute; inset: 0 auto auto 0; transform-origin: top left; }
.tn-tb-tool .tn-tb-connectors { position: absolute; inset: 0; max-width: none; pointer-events: none; overflow: visible; }
.tn-tb-tool .tn-tb-connectors path { fill: none; stroke: var(--tb-line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tn-tb-tool .tn-tb-round { position: absolute; min-width: 0; }
.tn-tb-tool .tn-tb-round > h3 { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: max-content; max-width: 100%; padding-inline: 10px; background: var(--tb-wash); text-align: center; font-size: 13px; line-height: 22px; font-weight: 700; }
.tn-tb-tool .tn-tb-match-list { position: static; }
.tn-tb-tool .tn-tb-match {
  position: absolute;
  width: 232px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 9px;
  min-width: 0;
  border: 1px solid var(--tb-line);
  background: var(--tb-paper);
}
.tn-tb-tool .tn-tb-match-heading { color: var(--tb-muted); -webkit-text-fill-color: var(--tb-muted); font-size: 11px; line-height: 16px; font-weight: 700; }
.tn-tb-tool .tn-tb-final-round .tn-tb-match { border-color: var(--tb-focus); border-top: 3px double var(--tb-focus); }
.tn-tb-tool .tn-tb-final-round .tn-tb-match-heading { color: var(--tb-focus); -webkit-text-fill-color: var(--tb-focus); }
.tn-tb-tool .tn-tb-entrant { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 5px; min-width: 0; border-top: 1px solid var(--tb-soft); padding-top: 4px; }
.tn-tb-tool .tn-tb-winner-option { display: flex; gap: 5px; align-items: center; min-width: 0; min-height: 32px; cursor: pointer; }
.tn-tb-tool input[type="radio"] { appearance: auto; -webkit-appearance: auto; flex: 0 0 15px; width: 15px; height: 15px; margin: 0; padding: 0; accent-color: var(--tb-focus); border-radius: 50%; cursor: pointer; }
.tn-tb-tool .tn-tb-entrant-name { min-width: 0; overflow-wrap: anywhere; white-space: normal; font-size: 14px; line-height: 1.5; font-weight: 600; }
.tn-tb-tool .tn-tb-score { height: 32px !important; min-height: 32px !important; padding-inline: 3px !important; text-align: center; font-family: var(--tb-sans); font-weight: 600 !important; font-variant-numeric: lining-nums tabular-nums; }
.tn-tb-tool input:disabled { opacity: 1; cursor: not-allowed; }
.tn-tb-tool .tn-tb-score:disabled { background: var(--tb-wash); border-style: dashed; }
.tn-tb-tool .tn-tb-match-status { font-size: 11px; line-height: 16px; }
.tn-tb-tool .tn-tb-destination { border-top: 1px solid var(--tb-soft); padding-top: 4px; }
.tn-tb-tool .tn-tb-match-actions { gap: 5px; }
.tn-tb-tool .tn-tb-match-actions button { flex: 1 1 0; height: 30px; min-height: 30px; padding-inline: 4px; font-size: 11px; }
.tn-tb-tool .tn-tb-number { font-family: var(--tb-sans); font-weight: 800; font-variant-numeric: lining-nums tabular-nums; }
.tn-tb-tool .tn-tb-placeholder { position: absolute; width: 140px; height: 56px; border: 1px dashed var(--tb-line); background: var(--tb-paper); display: grid; place-items: center; color: var(--tb-muted); -webkit-text-fill-color: var(--tb-muted); font-size: 12px; }
.tn-tb-tool .tn-tb-empty-fallback { display: grid; justify-items: center; gap: 24px; padding: 24px 8px; }
.tn-tb-tool .tn-tb-empty-fallback > div { display: flex; gap: 12px; width: 100%; justify-content: space-around; }
.tn-tb-tool .tn-tb-empty-fallback span { padding: 8px; border: 1px dashed var(--tb-line); font-size: 12px; text-align: center; }
.tn-tb-tool .tn-tb-exports { border-top: 1px solid var(--tb-soft); padding-block: 12px 8px; }
.tn-tb-tool #tnTbCopyLabel { margin-top: 12px; margin-bottom: 5px; }
.tn-tb-tool .tn-tb-storage { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tb-line); }
.tn-tb-tool .tn-tb-status { margin-top: 8px; color: var(--tb-muted); -webkit-text-fill-color: var(--tb-muted); font-size: 13px; }
.tn-tb-tool .tn-tb-status:empty { display: none; }
.tn-tb-tool .tn-tb-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tn-tb-page .tn-tb-ad { width: 100%; max-width: 100%; height: auto; min-height: 0; max-height: none; }
.tn-tb-page .tn-tb-ad :is(ins.adsbygoogle, iframe) { max-height: none; }
@media (max-width: 700px) {
  .tn-tb-tool .tn-tb-setup { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 14px; }
  .tn-tb-tool .tn-tb-settings { padding: 0; border: 0; gap: 12px; }
  .tn-tb-tool #tnTbNames { min-height: 200px; height: 200px; padding-inline: 12px; }
  .tn-tb-tool .tn-tb-create-row { padding-top: 14px; }
  .tn-tb-tool .tn-tb-output { padding: 10px; margin-top: 20px; }
  .tn-tb-tool .tn-tb-bracket { max-height: 75vh; }
  .tn-tb-tool .tn-tb-view-toolbar { gap: 10px; }
  .tn-tb-tool .tn-tb-round-nav { gap: 5px; }
  .tn-tb-tool .tn-tb-round-nav button { padding-inline: 9px; }
  .tn-tb-tool .tn-tb-actions { gap: 6px; }
  .tn-tb-tool .tn-tb-view-buttons { gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tn-tb-tool,
  .tn-tb-tool * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
