/* Number Base Converter - tool-specific styles (scoped with nb- prefix)
   Accent color for this tool: var(--site-light) (used only within nb- scoped classes,
   never overriding the global site header/title-bar). */

.nb-card { padding: 28px 30px; }
.nb-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -30px 24px; }
.nb-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; }

.nb-body { display: flex; flex-direction: column; gap: 20px; }

/* ===== Input row ===== */
.nb-input-row { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
.nb-input-field label, .nb-base-field label { display: block; font-weight: 700; font-size: .88em; color: #23272f; margin-bottom: 8px; }
#nbInputValue { width: 100%; box-sizing: border-box; border: 1px solid #ddd; border-radius: 8px; padding: 12px 14px; font-family: "Courier New", monospace; font-size: 1.1em; color: #23272f; background: #fafbfc; }
#nbInputValue:focus { outline: none; border-color: var(--site-light); box-shadow: 0 0 0 3px rgba(20, 184, 166, .12); background: #fff; }
#nbInputBase { width: 100%; box-sizing: border-box; border: 1px solid #ddd; border-radius: 8px; padding: 12px 14px; font-size: .95em; color: #23272f; background: #fafbfc; cursor: pointer; }
#nbInputBase:focus { outline: none; border-color: var(--site-light); box-shadow: 0 0 0 3px rgba(20, 184, 166, .12); }

/* ===== Error banner ===== */
.nb-error { background: var(--site-danger-bg); border: 1px solid var(--site-danger-border); color: var(--site-dark); border-radius: 8px; padding: 10px 14px; font-size: .88em; font-family: "Courier New", monospace; }
.nb-error.hide { display: none; }

/* ===== Result rows ===== */
.nb-results { display: flex; flex-direction: column; gap: 12px; }
.nb-result-row { border: 1px solid #eee; border-radius: 10px; padding: 14px 16px; background: #f7f8fa; }
.nb-result-label { font-size: .78em; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--site-dark); margin-bottom: 6px; }
.nb-result-value-wrap { display: flex; align-items: center; gap: 10px; }
.nb-result-value { flex: 1; display: block; font-family: "Courier New", monospace; font-size: 1.05em; word-break: break-all; color: #23272f; background: #fff; border: 1px solid #e6e6e6; border-radius: 8px; padding: 10px 12px; min-height: 1.3em; letter-spacing: .03em; }
.nb-result-value:empty::before { content: "-"; color: #9aa0aa; }

.nb-copy-btn { flex-shrink: 0; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #dfe2e8; border-radius: 8px; background: #fff; color: var(--site-dark); cursor: pointer; font-size: .95em; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.nb-copy-btn:hover { background: var(--site-light); border-color: var(--site-light); color: #fff; }
.nb-copy-btn.nb-copied { background: var(--site-success); border-color: var(--site-success); color: #fff; }

/* ===== Binary breakdown ===== */
.nb-breakdown { border-top: 1px dashed #e6e6e6; padding-top: 18px; }
.nb-breakdown label { display: block; font-weight: 700; font-size: .88em; color: #23272f; margin-bottom: 10px; }
.nb-breakdown-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.nb-breakdown-tag { flex-shrink: 0; font-size: .78em; font-weight: 700; color: #fff; background: var(--site-light); border-radius: 20px; padding: 4px 12px; }
.nb-breakdown-value { font-family: "Courier New", monospace; font-size: .95em; letter-spacing: .12em; word-break: break-all; color: #23272f; background: #f7f8fa; border: 1px solid #eee; border-radius: 8px; padding: 8px 12px; flex: 1; min-width: 180px; }

@media (max-width: 640px) {
    .nb-card { padding: 22px 18px; }
    .nb-title-bar { margin: -22px -18px 20px; }
    .nb-input-row { grid-template-columns: 1fr; }
    .nb-result-value { font-size: .92em; }
}
