:root {
  /* IP/DNS font size - adjustable via JavaScript (1.25em = effective 1.0em in 0.8em containers) */
  --ip-font-size: 1.25em;

  /* Standard colors */
  --color-ipv6-routing: #dbeafe;
  --color-ipv6-routing-text: #1e40af;
  --color-ipv6-subnet: #fef3c7;
  --color-ipv6-subnet-text: #92400e;
  --color-ipv6-interface: #d1fae5;
  --color-ipv6-interface-text: #065f46;
  --color-nibble-32: #dbeafe;
  --color-nibble-32-text: #1e40af;
  --color-nibble-48: #d1fae5;
  --color-nibble-48-text: #065f46;
  --color-nibble-56: #fef3c7;
  --color-nibble-56-text: #92400e;
  --color-nibble-64: #fce7f3;
  --color-nibble-64-text: #9d174d;
  --color-hierarchy-32: #7c3aed;
  --color-hierarchy-48: #2563eb;
  --color-hierarchy-56: #0891b2;
  --color-hierarchy-64: #059669;
}

/* Colorblind-friendly palette */
body.colorblind-mode {
  --color-ipv6-routing: #0077bb;
  --color-ipv6-routing-text: #ffffff;
  --color-ipv6-subnet: #ee7733;
  --color-ipv6-subnet-text: #000000;
  --color-ipv6-interface: #009988;
  --color-ipv6-interface-text: #ffffff;
  --color-nibble-32: #0077bb;
  --color-nibble-32-text: #ffffff;
  --color-nibble-48: #009988;
  --color-nibble-48-text: #ffffff;
  --color-nibble-56: #ee7733;
  --color-nibble-56-text: #000000;
  --color-nibble-64: #cc3311;
  --color-nibble-64-text: #ffffff;
  --color-hierarchy-32: #0077bb;
  --color-hierarchy-48: #009988;
  --color-hierarchy-56: #ee7733;
  --color-hierarchy-64: #cc3311;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 40px;
  max-width: 1200px;
  width: 100%;
  margin: 20px 0;
}

.table-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 40px;
  margin: 0 0 20px 0;
  width: fit-content;
  min-width: min(100%, 1200px);
  max-width: 95vw;
  overflow-x: auto;
}

.site-footer {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 30px 40px;
  margin: 0 0 20px 0;
  width: fit-content;
  min-width: min(100%, 1200px);
  max-width: 95vw;
  font-size: 0.85rem;
  color: #718096;
  text-align: center;
}

.site-footer a {
  color: #667eea;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-links {
  margin-bottom: 20px;
}

.footer-separator {
  margin: 0 8px;
  color: #cbd5e0;
}

.footer-section {
  margin: 20px 0;
  padding: 16px;
  background: #f7fafc;
  border-radius: 8px;
}

.footer-section h4 {
  margin: 0 0 12px 0;
  font-size: 0.9em;
  font-weight: 600;
  color: #4a5568;
}

.accessibility-options {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.accessibility-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accessibility-label {
  font-size: 0.85em;
  color: #4a5568;
}

.footer-credit {
  margin-top: 16px;
  font-size: 0.8em;
  color: #a0aec0;
}

h1, p, form, hr, table.calc {
  text-align: center;
}

.input-table, .calc {
  margin: 0 auto;
}

h1 {
  font-size: 1.5rem;
  color: #1a202c;
  margin-bottom: 4px;
}

.version-toggle {
  font-size: 0.85em;
  margin-bottom: 12px;
}

.version-toggle a {
  color: #667eea;
  text-decoration: none;
}

.version-toggle a:hover {
  text-decoration: underline;
}

p {
  font-size: 75%;
}

.label {
  font-size: 60%;
}


.input-table {
  border-spacing: 0;
}

.calc {
  font-size: 80%;
  border-collapse: collapse;
}

.calc td {
  border: 1px solid black;
  padding: 4px 8px;
}

/* IP/DNS cells in main table use adjustable font size */
.calc td[data-col="network"],
.calc td[data-col="range"],
.calc td[data-col="firstusable"],
.calc td[data-col="lastusable"],
.calc td[data-col="broadcast"],
.calc td[data-col="reversedns"] {
  font-size: var(--ip-font-size);
}

.calc thead {
  font-weight: bold;
  background-color: #666666;
  color: #ffffff;
}

.calc thead td {
  text-align: center;
}

.calc tbody tr:nth-child(odd) {
  background-color: #f5f5f5;
}

.calc tbody tr:nth-child(even) {
  background-color: #ffffff;
}

.calc tbody tr.input-network {
  font-weight: bold;
  color: green;
}

.calc tbody tr.row-highlight td:not([data-col="divide"]):not([data-col="join"]):not([data-col="clipboard"]) {
  background-color: #fffacd;
}

.clipboard-cell {
  text-align: center;
  white-space: nowrap;
}

.format-buttons {
  display: inline-block;
  margin-left: 8px;
}

.format-btn {
  cursor: pointer;
  color: #0066cc;
  text-decoration: none;
  padding: 1px 4px;
  border: 1px solid #0066cc;
  border-radius: 3px;
  background-color: #f0f7ff;
  font-size: 10px;
  font-weight: normal;
  margin-left: 2px;
}

.format-btn:hover {
  color: #ffffff;
  background-color: #0066cc;
}

.format-btn-active {
  color: #ffffff;
  background-color: #0066cc;
}

.clipboard-link {
  cursor: pointer;
  color: #0066cc;
  text-decoration: none;
  padding: 2px 6px;
  border: 1px solid #0066cc;
  border-radius: 3px;
  background-color: #f0f7ff;
  font-size: 11px;
}

.clipboard-link:hover {
  color: #ffffff;
  background-color: #0066cc;
}

.clipboard-separator {
  display: inline-block;
  width: 8px;
}

.disabledAction {
  color: #cccccc;
  padding: 2px 8px;
  border: 1px solid #cccccc;
  border-radius: 3px;
  background-color: #f5f5f5;
  font-size: 11px;
  cursor: not-allowed;
}

.divide-btn {
  cursor: pointer;
  color: #0066cc;
  text-decoration: none;
  padding: 2px 8px;
  border: 1px solid #0066cc;
  border-radius: 3px;
  background-color: #f0f7ff;
  font-size: 11px;
  display: inline-block;
}

.divide-btn:hover {
  color: #ffffff;
  background-color: #0066cc;
}

.maskSpan {
  background-color: #ffffff;
  color: #000000;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  min-width: 40px;
}

.maskSpanJoinable {
  background-color: #ffffff;
  color: #000000;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  min-width: 40px;
  cursor: pointer;
}

.maskSpanJoinable:hover {
  background-color: #dddddd;
}

.hidden-column {
  display: none;
}

hr {
  border: none;
  border-top: 1px solid black;
  margin: 20px 0;
}

.column-select-container {
  margin: 10px 0;
}

.column-select-container label {
  display: block;
  font-size: 75%;
  margin-bottom: 4px;
}

.column-select {
  width: 200px;
  font-size: 80%;
  padding: 4px;
}

/* Table header - title and description */
.table-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}

.table-header h2 {
  margin: 0 0 6px 0;
  font-size: 1.1em;
  color: #1a202c;
  font-weight: 600;
}

.table-header .table-description {
  margin: 0;
  font-size: 0.85em;
  color: #4a5568;
  line-height: 1.5;
  max-width: 700px;
  margin: 0 auto;
}

.table-header .table-description strong {
  color: #2d3748;
}

/* Table controls - at top of table container */
.table-controls {
  display: flex;
  gap: 24px;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  align-items: flex-start;
  justify-content: center;
}

.table-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-control-group > label {
  font-size: 12px;
  font-weight: 600;
  color: #495057;
}

.table-controls .column-select {
  width: 180px;
  font-size: 12px;
}

.split-mode-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.split-mode-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
}

.split-mode-label input[type="radio"] {
  margin: 0;
}

/* Display options (font size, colorblind mode) */
.display-options {
  display: flex;
  gap: 16px;
  align-items: center;
}

.display-option {
  display: flex;
  align-items: center;
  gap: 6px;
}

.display-label {
  font-size: 12px;
  color: #495057;
}

.font-size-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495057;
}

.font-size-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.font-size-btn:active {
  background: #dee2e6;
}

.font-size-indicator {
  font-size: 11px;
  color: #6c757d;
  min-width: 36px;
  text-align: center;
}

.colorblind-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  color: #495057;
}

.colorblind-label input[type="checkbox"] {
  margin: 0;
}

/* IP/DNS text sizing class */
.ip-text {
  font-size: var(--ip-font-size);
}

input[type="text"] {
  padding: 4px;
}

/* Copy link button next to input */
.copy-link-btn {
  display: inline-block;
  margin-left: 8px;
  cursor: pointer;
  color: #0066cc;
  text-decoration: none;
  padding: 2px 6px;
  border: 1px solid #0066cc;
  border-radius: 3px;
  background-color: #f0f7ff;
  font-size: 11px;
  vertical-align: middle;
}

.copy-link-btn:hover {
  color: #ffffff;
  background-color: #0066cc;
}

.copy-link-btn.copied {
  background-color: #28a745;
  border-color: #28a745;
  color: #ffffff;
}

input[type="text"].invalid {
  background-color: #ffcccc;
}

.help-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background-color: #666;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: help;
  position: relative;
  margin: 0 4px;
}

.help-icon:hover .help-tooltip {
  display: block;
}

.help-icon-light {
  background-color: #fff;
  color: #666;
}

.help-icon-light:hover {
  background-color: #ddd;
}

.help-tooltip {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: normal;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.help-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
}

.network-status {
  text-align: center;
  margin: 15px 0;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 0.9em;
  display: none;
}

.network-status.visible {
  display: block;
}

.network-status.reserved {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

.network-status.public {
  background-color: #d4edda;
  border: 1px solid #28a745;
  color: #155724;
}

.network-status a {
  color: inherit;
  font-weight: bold;
}

.reserved-networks-container {
  margin: 15px 0;
  text-align: center;
}

.reserved-networks-container label {
  font-size: 0.85em;
  color: #4a5568;
  margin-right: 8px;
}

.reserved-networks-select {
  font-size: 0.85em;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  min-width: 300px;
  max-width: 90vw;
}

.table-clipboard-container {
  text-align: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.table-clipboard-container .clipboard-label {
  font-size: 0.85em;
  color: #4a5568;
  margin-right: 10px;
}

.table-clipboard-container .clipboard-link {
  margin: 0 4px;
}

.boundary-buttons-container {
  text-align: center;
  margin: 10px 0;
}

.boundary-buttons-container label {
  font-size: 0.85em;
  color: #4a5568;
  margin-right: 8px;
}

.boundary-btn {
  cursor: pointer;
  color: #0066cc;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #0066cc;
  border-radius: 3px;
  background-color: #f0f7ff;
  font-size: 12px;
  margin: 0 3px;
  display: inline-block;
}

.boundary-btn:hover {
  color: #ffffff;
  background-color: #0066cc;
}

/* IPv6 address color-coding */
.ipv6-addr {
  font-family: monospace;
  font-size: var(--ip-font-size);
}

.ipv6-routing {
  background-color: var(--color-ipv6-routing);
  color: var(--color-ipv6-routing-text);
  padding: 1px 2px;
  border-radius: 2px;
}

.ipv6-subnet {
  background-color: var(--color-ipv6-subnet);
  color: var(--color-ipv6-subnet-text);
  padding: 1px 2px;
  border-radius: 2px;
}

.ipv6-interface {
  background-color: var(--color-ipv6-interface);
  color: var(--color-ipv6-interface-text);
  padding: 1px 2px;
  border-radius: 2px;
}

/* Binary visualization for non-nibble splits */
.bit-split-viz {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  background: #1a202c;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.6;
}

.bit-split-viz .viz-title {
  display: block;
  color: #a0aec0;
  font-size: 10px;
  margin-bottom: 6px;
  font-weight: 500;
}

.bit-split-viz .viz-bits {
  display: flex;
  gap: 1px;
  font-family: monospace;
  font-size: 14px;
  margin-bottom: 6px;
}

.bit-split-viz .bit-cell {
  width: 18px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  cursor: help;
  position: relative;
  font-weight: bold;
}

.bit-split-viz .bit-cell:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2d3748;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 10;
  margin-bottom: 4px;
  font-weight: normal;
}

.bit-split-viz .bit-network {
  background: #3182ce;
  color: #fff;
}

.bit-split-viz .bit-host {
  background: #38a169;
  color: #fff;
}

.bit-split-viz .split-marker {
  background: #e53e3e;
  color: #fff;
  width: 6px;
  font-size: 16px;
}

.bit-split-viz .viz-legend {
  display: flex;
  gap: 12px;
  font-size: 10px;
  color: #a0aec0;
  margin-top: 4px;
}

.bit-split-viz .viz-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bit-split-viz .viz-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.bit-split-viz .viz-legend-swatch.network {
  background: #3182ce;
}

.bit-split-viz .viz-legend-swatch.host {
  background: #38a169;
}

.bit-split-viz .viz-legend-swatch.split {
  background: #e53e3e;
}

/* Legend for IPv6 color coding */
.ipv6-legend {
  display: inline-flex;
  gap: 12px;
  font-size: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.ipv6-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ipv6-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.ipv6-legend-swatch.routing {
  background-color: #dbeafe;
  border: 1px solid #1e40af;
}

.ipv6-legend-swatch.subnet {
  background-color: #fef3c7;
  border: 1px solid #92400e;
}

.ipv6-legend-swatch.interface {
  background-color: #d1fae5;
  border: 1px solid #065f46;
}

/* Boundary Dashboard */
.boundary-dashboard {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-align: left;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
}

.dashboard-header h3 {
  margin: 0;
  font-size: 1.1em;
  color: #1a202c;
}

.close-dashboard {
  background: none;
  border: none;
  font-size: 1.5em;
  color: #718096;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.close-dashboard:hover {
  color: #e53e3e;
}

.dashboard-section {
  margin-bottom: 18px;
  padding: 12px 15px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.dashboard-section:last-child {
  margin-bottom: 0;
}

.dashboard-section h4 {
  margin: 0 0 8px 0;
  font-size: 0.95em;
  color: #4a5568;
}

.dashboard-section p {
  margin: 0;
  font-size: 0.9em;
  color: #2d3748;
  line-height: 1.5;
}

.dashboard-section .section-desc {
  color: #718096;
  font-size: 0.85em;
  margin-top: 8px;
}

.dashboard-section a {
  color: #667eea;
  text-decoration: none;
}

.dashboard-section a:hover {
  text-decoration: underline;
}

.capacity-section {
  border-left-color: #48bb78;
}

.capacity-section p {
  font-size: 1em;
  font-weight: 500;
}

.capacity-section .stat-highlight {
  color: #2f855a;
  font-weight: bold;
}

.next-steps-section {
  border-left-color: #ed8936;
}

.subnet-examples {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.example-column {
  flex: 1;
  min-width: 0;
}

.example-column h5 {
  margin: 0 0 8px 0;
  font-size: 0.85em;
  color: #744210;
  font-weight: 600;
}

.example-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.example-column li {
  font-family: monospace;
  font-size: var(--ip-font-size);
  padding: 4px 8px;
  margin: 3px 0;
  background: #fffaf0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.example-column li:hover {
  background: #feebc8;
}

.example-column li.example-header {
  background: #ed8936;
  color: white;
  font-weight: bold;
  font-family: inherit;
  cursor: default;
}

.boundary-visual-section {
  border-left-color: #667eea;
}

.boundary-visual {
  font-family: monospace;
  font-size: var(--ip-font-size);
  padding: 10px;
  background: #374151;
  color: #e2e8f0;
  border-radius: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.boundary-visual .bv-routing {
  color: #63b3ed;
  font-weight: bold;
}

.boundary-visual .bv-subnet {
  color: #fbd38d;
}

.boundary-visual .bv-interface {
  color: #9ae6b4;
  opacity: 0.6;
}

.boundary-visual .bv-separator {
  color: #718096;
}

.boundary-visual .bv-mask {
  color: #a0aec0;
  font-size: 0.85em;
}

.reverse-dns-section {
  border-left-color: #9f7aea;
}

.reverse-dns-output {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.reverse-dns-output code {
  flex: 1;
  font-family: monospace;
  font-size: var(--ip-font-size);
  padding: 8px 12px;
  background: #faf5ff;
  border: 1px solid #d6bcfa;
  border-radius: 4px;
  word-break: break-all;
}

.copy-btn {
  padding: 6px 12px;
  background: #9f7aea;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.8em;
  cursor: pointer;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #805ad5;
}

.copy-btn.copied {
  background: #48bb78;
}

/* Active boundary button state */
.boundary-btn.active {
  color: #ffffff;
  background-color: #0066cc;
  border-color: #0066cc;
}

/* Binary Mask View - 128-bit visualization */
.binary-mask-section {
  border-left-color: #4299e1;
}

.binary-mask-view {
  font-family: monospace;
  font-size: var(--ip-font-size);
  background: #374151;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.binary-mask-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.binary-mask-row:last-child {
  margin-bottom: 0;
}

.binary-mask-label {
  width: 70px;
  color: #a0aec0;
  font-size: 11px;
  text-align: right;
  padding-right: 8px;
  flex-shrink: 0;
}

.binary-mask-bits {
  display: flex;
  gap: 1px;
}

.binary-mask-nibble {
  display: flex;
  margin-right: 3px;
}

.binary-mask-nibble:nth-child(4n) {
  margin-right: 8px;
}

.binary-mask-nibble:last-child {
  margin-right: 0;
}

.bm-bit {
  width: 0.9em;
  height: 1.4em;
  font-size: calc(var(--ip-font-size) * 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1px;
  cursor: help;
}

.bm-bit.prefix {
  background: #3182ce;
  color: #fff;
}

.bm-bit.host {
  background: #2d3748;
  color: #718096;
}

.bm-bit.boundary {
  background: #e53e3e;
  color: #fff;
}

.binary-mask-hex {
  margin-left: 10px;
  color: #a0aec0;
  font-size: 11px;
  flex-shrink: 0;
}

.binary-mask-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2d3748;
}

.bm-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #a0aec0;
  font-size: 11px;
}

.bm-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.bm-legend-swatch.prefix {
  background: #3182ce;
}

.bm-legend-swatch.host {
  background: #2d3748;
  border: 1px solid #4a5568;
}

.bm-legend-swatch.boundary {
  background: #e53e3e;
}

.binary-mask-info {
  color: #718096;
  font-size: 10px;
  margin-top: 8px;
  text-align: center;
}

.binary-mask-info .nibble-warning {
  color: #ed8936;
  font-weight: 500;
}

.binary-mask-info .nibble-ok {
  color: #48bb78;
}

/* Inline SLAAC Generator for /64 rows */
.slaac-btn {
  cursor: pointer;
  color: #059669;
  text-decoration: none;
  padding: 2px 8px;
  border: 1px solid #059669;
  border-radius: 3px;
  background-color: #ecfdf5;
  font-size: 11px;
  display: inline-block;
  margin-left: 6px;
}

.slaac-btn:hover {
  color: #ffffff;
  background-color: #059669;
}

.slaac-btn.active {
  color: #ffffff;
  background-color: #059669;
}

.slaac-panel-row td {
  background-color: #f0fdf4 !important;
  border-top: none !important;
  padding: 12px 16px !important;
}

.slaac-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.slaac-panel-label {
  font-size: 0.9em;
  color: #065f46;
  font-weight: 500;
}

.slaac-panel-prefix {
  font-family: monospace;
  background: #d1fae5;
  padding: 4px 8px;
  border-radius: 4px;
  color: #047857;
  font-size: 0.85em;
}

.slaac-panel-plus {
  font-size: 1.2em;
  color: #059669;
  font-weight: bold;
}

.slaac-panel input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  font-size: 0.9em;
  width: 160px;
  font-family: monospace;
}

.slaac-panel input[type="text"]:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.slaac-panel-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.slaac-panel-result-label {
  font-size: 0.8em;
  color: #6b7280;
}

.slaac-panel-copy {
  font-family: monospace;
  font-size: var(--ip-font-size);
  background: #047857;
  color: #ffffff;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.slaac-panel-copy:hover {
  background: #065f46;
}

.slaac-panel-copy.copied {
  background: #0369a1;
}

.slaac-panel-close {
  cursor: pointer;
  color: #9ca3af;
  font-size: 1.2em;
  padding: 2px 6px;
  border: none;
  background: none;
  margin-left: 8px;
}

.slaac-panel-close:hover {
  color: #ef4444;
}

.slaac-panel-error {
  color: #dc2626;
  font-size: 0.85em;
  background: #fef2f2;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Subnet Map - Hierarchical View */
.subnet-map-section {
  border-left-color: #8b5cf6;
}

.subnet-map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8em;
  margin-top: 10px;
}

.subnet-map-table th,
.subnet-map-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.subnet-map-table th {
  background: #f3f4f6;
  font-weight: 600;
  color: #374151;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subnet-map-table tbody tr:hover {
  background: #f9fafb;
}

/* Row level indicators */
.subnet-map-table tr.level-parent {
  background: #eff6ff;
}

.subnet-map-table tr.level-parent:hover {
  background: #dbeafe;
}

.subnet-map-table tr.level-selected {
  background: #fef3c7;
  font-weight: 600;
}

.subnet-map-table tr.level-selected:hover {
  background: #fde68a;
}

.subnet-map-table tr.level-child {
  background: #f0fdf4;
}

.subnet-map-table tr.level-child:hover {
  background: #dcfce7;
}

/* Level badge */
.level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
}

.level-badge.parent {
  background: #dbeafe;
  color: #1e40af;
}

.level-badge.selected {
  background: #fef3c7;
  color: #92400e;
}

.level-badge.child {
  background: #d1fae5;
  color: #065f46;
}

.level-badge.first {
  background: #e0e7ff;
  color: #3730a3;
}

.level-badge.current {
  background: #fef3c7;
  color: #92400e;
}

.level-badge.last {
  background: #fce7f3;
  color: #9d174d;
}

/* Prefix with nibble highlighting */
.subnet-map-prefix {
  font-family: monospace;
  font-size: var(--ip-font-size);
  cursor: pointer;
}

.subnet-map-prefix:hover {
  text-decoration: underline;
}

.nibble-32 {
  background: var(--color-nibble-32);
  color: var(--color-nibble-32-text);
  padding: 1px 2px;
  border-radius: 2px;
}

.nibble-48 {
  background: var(--color-nibble-48);
  color: var(--color-nibble-48-text);
  padding: 1px 2px;
  border-radius: 2px;
}

.nibble-56 {
  background: var(--color-nibble-56);
  color: var(--color-nibble-56-text);
  padding: 1px 2px;
  border-radius: 2px;
}

.nibble-64 {
  background: var(--color-nibble-64);
  color: var(--color-nibble-64-text);
  padding: 1px 2px;
  border-radius: 2px;
}

.nibble-host {
  color: #9ca3af;
}

/* Subnet Map Legend */
.subnet-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.8em;
  color: #6b7280;
  align-items: center;
}

.subnet-map-legend .legend-title {
  font-weight: 600;
  color: #374151;
}

.subnet-map-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.subnet-map-legend .legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.subnet-map-legend .nibble-host-swatch {
  background: #f3f4f6;
  border: 1px solid #9ca3af;
}

/* Role descriptions */
.role-desc {
  font-size: 0.85em;
  color: #6b7280;
}

.role-desc strong {
  color: #374151;
}

/* Capacity column */
.capacity-value {
  font-weight: 500;
  color: #059669;
}

.capacity-unit {
  font-size: 0.8em;
  color: #6b7280;
  margin-left: 4px;
}

/* Navigation buttons */
.nav-btn-group {
  display: flex;
  gap: 4px;
}

.nav-btn {
  cursor: pointer;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  font-size: 0.75em;
  color: #374151;
  transition: all 0.15s;
}

.nav-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

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

.nav-btn.nav-prev,
.nav-btn.nav-next {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.nav-btn.nav-prev::before {
  content: '←';
}

.nav-btn.nav-next::before {
  content: '→';
}

.nav-btn.nav-load {
  background: #8b5cf6;
  color: white;
  border-color: #8b5cf6;
}

.nav-btn.nav-load:hover {
  background: #7c3aed;
}

/* Subnet position indicator */
.subnet-position {
  font-size: 0.7em;
  color: #9ca3af;
  margin-left: 8px;
}

/* Separator rows for hierarchy levels */
.subnet-map-table tr.level-separator td {
  padding: 4px 12px;
  background: #f9fafb;
  font-size: 0.75em;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e5e7eb;
}

/* ===========================================
   IPv6 Allocation Hierarchy (Standalone Table)
   =========================================== */

.hierarchy-container {
  margin: 20px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  text-align: left;
}

.hierarchy-container h3 {
  margin: 0 0 4px 0;
  font-size: 1.1em;
  color: #0c4a6e;
  font-weight: 600;
}

.hierarchy-container .hierarchy-desc {
  margin: 0 0 16px 0;
  font-size: 0.85em;
  color: #0369a1;
}

.hierarchy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8em;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hierarchy-table th {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: white;
  padding: 10px 12px;
  font-size: 0.8em;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hierarchy-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.hierarchy-row {
  background: #f0f9ff;
  border-bottom: 1px solid #bfdbfe;
}

.hierarchy-row:hover {
  background: #dbeafe;
}

.hierarchy-row.hierarchy-current {
  background: #dbeafe;
  border-left: 4px solid #2563eb;
}

.hierarchy-row.hierarchy-parent {
  background: #f8fafc;
  opacity: 0.9;
}

.hierarchy-row.hierarchy-child {
  background: #fefce8;
}

.hierarchy-level {
  width: 60px;
  text-align: center;
  padding: 8px !important;
}

.hierarchy-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85em;
  color: #fff;
}

.hierarchy-badge-32 {
  background: var(--color-hierarchy-32);
}

.hierarchy-badge-48 {
  background: var(--color-hierarchy-48);
}

.hierarchy-badge-56 {
  background: var(--color-hierarchy-56);
}

.hierarchy-badge-64 {
  background: var(--color-hierarchy-64);
}

.hierarchy-network {
  padding: 8px 12px !important;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: var(--ip-font-size);
}

.hierarchy-network-link {
  color: #1d4ed8;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dashed #93c5fd;
}

.hierarchy-network-link:hover {
  color: #1e40af;
  border-bottom-color: #1e40af;
}

.hierarchy-whois {
  margin-left: 12px;
  padding: 2px 8px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.75em;
  color: #6b7280;
  text-decoration: none;
  font-family: system-ui, sans-serif;
}

.hierarchy-whois:hover {
  background: #e5e7eb;
  color: #374151;
}

.hierarchy-role {
  padding: 8px 12px !important;
  font-size: 0.85em;
  line-height: 1.4;
}

.hierarchy-role strong {
  color: #1f2937;
}

.hierarchy-role-desc {
  color: #6b7280;
  font-size: 0.9em;
}

.hierarchy-dns {
  padding: 8px 12px !important;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: var(--ip-font-size);
  color: #4b5563;
  word-break: break-all;
}

.hierarchy-capacity {
  padding: 8px 12px !important;
  text-align: right;
}

.hierarchy-capacity-value {
  font-weight: 600;
  color: #1f2937;
}

.hierarchy-capacity-unit {
  color: #6b7280;
  font-size: 0.85em;
  margin-left: 4px;
}

.hierarchy-empty {
  background: transparent;
}

.hierarchy-separator {
  background: #f9fafb;
}

.hierarchy-separator-cell {
  padding: 8px 16px !important;
  font-size: 0.8em;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 2px solid #e5e7eb;
  border-bottom: 1px solid #d1d5db;
}
