.tn-hwc-page {
  --hwc-ink: #1a1208;
  --hwc-muted: #5a4a30;
  --hwc-line: #b8a888;
  --hwc-soft-line: #ddd4be;
  --hwc-paper: #faf6ee;
  --hwc-panel: #fffdf7;
  --hwc-wash: #f5efdf;
  --hwc-button: #ede6d4;
  --hwc-button-hover: #dfd4bb;
  --hwc-accent: #c44a00;
  --hwc-accent-dark: #893600;
  --hwc-ok: #2f6845;
  --hwc-warning: #9a3f16;
  --hwc-base: #6f5637;
  --hwc-rest: #c44a00;
  --hwc-premium: #9b7553;
  width: min(1180px, 100%);
  margin-inline: auto;
  color: var(--hwc-ink);
}

.tn-hwc-page *,
.tn-hwc-page *::before,
.tn-hwc-page *::after {
  box-sizing: border-box;
}

.tn-hwc-tool {
  margin: 48px 0 0;
  color: var(--hwc-ink);
}

.tn-hwc-tool :is(ul, ol, li, dl, dt, dd) {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tn-hwc-tool :is(code, pre, kbd, samp) {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.tn-hwc-tool p {
  margin: 0;
}

.tn-hwc-tool button,
.tn-hwc-tool input,
.tn-hwc-tool select {
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', system-ui, sans-serif;
}

.tn-hwc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.tn-hwc-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.tn-hwc-pane-label {
  margin: 0 0 12px !important;
  color: var(--hwc-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tn-hwc-pane-shell {
  display: grid;
  min-width: 0;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--hwc-line);
  border-radius: 0;
  background: var(--hwc-panel);
}

.tn-hwc-pane--input .tn-hwc-pane-shell {
  align-content: start;
  gap: 16px;
}

.tn-hwc-pane--result .tn-hwc-pane-shell {
  grid-template-rows: minmax(144px, 1fr) auto auto auto;
  align-content: stretch;
  gap: 14px;
}

.tn-hwc-band {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-paper);
}

.tn-hwc-band-label {
  color: var(--hwc-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

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

.tn-hwc-field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 5px;
  border: 0;
  background: transparent;
}

.tn-hwc-field > span,
.tn-hwc-switch > span {
  color: var(--hwc-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
}

.tn-hwc-control {
  position: relative;
  display: flex !important;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--hwc-line);
  background: var(--hwc-panel);
}

.tn-hwc-control input,
.tn-hwc-control select {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  height: 36px;
  margin: 0;
  padding: 0 11px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--hwc-ink);
  -webkit-text-fill-color: var(--hwc-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 36px;
  font-variant-numeric: lining-nums tabular-nums;
  box-shadow: none;
}

.tn-hwc-control select {
  appearance: none;
  padding-right: 32px;
  cursor: pointer;
}

.tn-hwc-control--select::after {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--hwc-muted);
  border-bottom: 1.5px solid var(--hwc-muted);
  content: '';
  pointer-events: none;
  transform: translateY(-68%) rotate(45deg);
}

.tn-hwc-control b {
  display: grid;
  min-width: 40px;
  height: 36px;
  place-items: center;
  padding: 0 8px;
  border: 0;
  border-left: 1px solid var(--hwc-soft-line);
  background: var(--hwc-wash);
  color: var(--hwc-muted);
  -webkit-text-fill-color: var(--hwc-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.tn-hwc-control:has(:focus-visible) {
  outline: 2px solid var(--hwc-accent);
  outline-offset: 2px;
}

.tn-hwc-control input::placeholder {
  color: var(--hwc-muted);
  font-weight: 400;
  opacity: .35;
}

.tn-hwc-switch {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-wash);
  cursor: pointer;
}

.tn-hwc-switch input {
  appearance: none;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin: 0;
  border: 1px solid var(--hwc-line);
  border-radius: 0;
  background: var(--hwc-panel);
  cursor: pointer;
}

.tn-hwc-switch input:checked {
  border-color: var(--hwc-accent);
  background: var(--hwc-accent);
  box-shadow: inset 0 0 0 4px var(--hwc-panel);
}

.tn-hwc-switch input:focus-visible {
  outline: 2px solid var(--hwc-accent);
  outline-offset: 2px;
}

.tn-hwc-advanced {
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-paper);
}

.tn-hwc-advanced summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  color: var(--hwc-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 20px;
  cursor: pointer;
  list-style: none;
}

.tn-hwc-advanced summary::-webkit-details-marker {
  display: none;
}

.tn-hwc-advanced summary::after {
  content: '+';
  color: var(--hwc-accent);
  font-size: 18px;
  line-height: 1;
}

.tn-hwc-advanced[open] summary::after {
  content: '−';
}

.tn-hwc-advanced-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--hwc-soft-line);
}

.tn-hwc-advanced-note,
.tn-hwc-disclaimer,
.tn-hwc-overlap-note {
  color: var(--hwc-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.tn-hwc-actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 8px;
}

.tn-hwc-actions button {
  display: grid;
  width: 100%;
  min-width: 0;
  height: 38px;
  place-items: center;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--hwc-line);
  border-radius: 0;
  outline: 0;
  background: var(--hwc-button);
  color: var(--hwc-ink);
  -webkit-text-fill-color: var(--hwc-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
}

.tn-hwc-actions button:hover {
  background: var(--hwc-button-hover);
}

.tn-hwc-actions button:focus-visible {
  outline: 2px solid var(--hwc-accent);
  outline-offset: 2px;
}

.tn-hwc-actions .tn-hwc-primary {
  border-color: var(--hwc-accent-dark);
  background: var(--hwc-accent-dark);
  color: #fffaf0;
  -webkit-text-fill-color: #fffaf0;
}

.tn-hwc-actions .tn-hwc-primary:hover {
  background: #6f2d05;
}

.tn-hwc-status,
.tn-hwc-error {
  width: 100%;
  padding: 10px 12px !important;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-wash);
  color: var(--hwc-muted);
  -webkit-text-fill-color: var(--hwc-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.tn-hwc-error {
  border-color: color-mix(in srgb, var(--hwc-warning) 45%, var(--hwc-soft-line));
  color: var(--hwc-warning);
  -webkit-text-fill-color: var(--hwc-warning);
}

.tn-hwc-status[hidden],
.tn-hwc-error[hidden] {
  display: none;
}

.tn-hwc-hero-result {
  display: grid;
  min-width: 0;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 18px 14px;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-paper);
  text-align: center;
}

.tn-hwc-hero-result > span {
  color: var(--hwc-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.tn-hwc-hero-result > strong {
  max-width: 100%;
  color: var(--hwc-ink);
  -webkit-text-fill-color: var(--hwc-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(31px, 4.3vw, 54px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

.tn-hwc-badge {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  padding: 4px 9px;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-panel);
  color: var(--hwc-ok);
  -webkit-text-fill-color: var(--hwc-ok);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.tn-hwc-badge[data-state='warning'] {
  color: var(--hwc-warning);
  -webkit-text-fill-color: var(--hwc-warning);
}

.tn-hwc-summary {
  max-width: 43ch;
  color: var(--hwc-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5;
}

.tn-hwc-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tn-hwc-metrics > div {
  display: grid;
  min-width: 0;
  min-height: 76px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 10px 8px;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-panel);
  text-align: center;
}

.tn-hwc-metrics dt {
  color: var(--hwc-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.tn-hwc-metrics dd {
  max-width: 100%;
  overflow: hidden;
  color: var(--hwc-ink);
  -webkit-text-fill-color: var(--hwc-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(14px, 1.7vw, 19px);
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

.tn-hwc-bar {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-wash);
}

.tn-hwc-bar-head,
.tn-hwc-bar-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tn-hwc-bar-head {
  grid-template-columns: 1fr auto;
  align-items: baseline;
  color: var(--hwc-muted);
  font-size: 11px;
  font-weight: 800;
}

.tn-hwc-bar-head b {
  color: var(--hwc-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: lining-nums tabular-nums;
}

.tn-hwc-bar-track {
  display: flex;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--hwc-line);
  background: var(--hwc-panel);
}

.tn-hwc-bar-track span {
  display: block;
  width: 0;
  height: 100%;
  transition: width .18s ease;
}

.tn-hwc-bar-base { background: var(--hwc-base); }
.tn-hwc-bar-rest { background: var(--hwc-rest); }
.tn-hwc-bar-premium { background: var(--hwc-premium); }

.tn-hwc-bar-legend > span {
  display: grid;
  min-width: 0;
  grid-template-columns: 8px 1fr;
  gap: 2px 6px;
  align-items: center;
  color: var(--hwc-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.tn-hwc-bar-legend i {
  width: 8px;
  height: 8px;
  background: var(--hwc-base);
}

.tn-hwc-bar-legend .is-rest { background: var(--hwc-rest); }
.tn-hwc-bar-legend .is-premium { background: var(--hwc-premium); }

.tn-hwc-bar-legend b {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  color: var(--hwc-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

.tn-hwc-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hwc-soft-line);
}

.tn-hwc-detail > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: baseline;
  color: var(--hwc-muted);
  font-size: 11px;
  line-height: 1.3;
}

.tn-hwc-detail strong {
  color: var(--hwc-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Segoe UI', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: lining-nums tabular-nums;
}

.tn-hwc-overlap-note {
  grid-column: 1 / -1;
  padding: 9px 10px !important;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-wash);
}

.tn-hwc-disclaimer {
  padding: 10px 12px !important;
  border: 1px solid var(--hwc-soft-line);
  background: var(--hwc-paper);
  text-align: center;
}

body:is([data-scheme='dark'], [data-scheme='inverse']) .tn-hwc-page,
html:is([data-scheme='dark'], [data-scheme='inverse']) body .tn-hwc-page,
html[data-theme='dark'] body .tn-hwc-page,
body.dark-mode .tn-hwc-page,
html.dark body .tn-hwc-page {
  --hwc-ink: #f5ead7;
  --hwc-muted: #d1c1a8;
  --hwc-line: #77654d;
  --hwc-soft-line: #5d4d3b;
  --hwc-paper: #2e261d;
  --hwc-panel: #241d17;
  --hwc-wash: #382e23;
  --hwc-button: #453728;
  --hwc-button-hover: #51402e;
  --hwc-accent: #f09a62;
  --hwc-accent-dark: #7a3212;
  --hwc-ok: #9dd3ae;
  --hwc-warning: #ffad7a;
  --hwc-base: #cfb58e;
  --hwc-rest: #f09a62;
  --hwc-premium: #bd8e68;
}

@media (prefers-color-scheme: dark) {
  body[data-scheme='auto'] .tn-hwc-page,
  html[data-scheme='auto'] body .tn-hwc-page {
    --hwc-ink: #f5ead7;
    --hwc-muted: #d1c1a8;
    --hwc-line: #77654d;
    --hwc-soft-line: #5d4d3b;
    --hwc-paper: #2e261d;
    --hwc-panel: #241d17;
    --hwc-wash: #382e23;
    --hwc-button: #453728;
    --hwc-button-hover: #51402e;
    --hwc-accent: #f09a62;
    --hwc-accent-dark: #7a3212;
    --hwc-ok: #9dd3ae;
    --hwc-warning: #ffad7a;
    --hwc-base: #cfb58e;
    --hwc-rest: #f09a62;
    --hwc-premium: #bd8e68;
  }
}

@media (max-width: 760px) {
  .tn-hwc-tool {
    margin-top: 40px;
  }

  .tn-hwc-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .tn-hwc-pane {
    display: block;
  }

  .tn-hwc-pane-shell {
    height: auto;
    padding: 14px;
  }

  .tn-hwc-pane--result .tn-hwc-pane-shell {
    grid-template-rows: auto;
  }

  .tn-hwc-hero-result {
    min-height: 150px;
  }
}

@media (max-width: 430px) {
  .tn-hwc-page {
    width: calc(100% - 10px);
  }

  .tn-hwc-fields,
  .tn-hwc-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .tn-hwc-actions {
    grid-template-columns: 1fr 1fr;
  }

  .tn-hwc-actions .tn-hwc-primary {
    grid-column: 1 / -1;
  }

  .tn-hwc-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tn-hwc-bar-legend {
    grid-template-columns: minmax(0, 1fr);
  }

  .tn-hwc-hero-result > strong {
    font-size: clamp(28px, 10.5vw, 40px);
  }
}
