/* ChipReign Tools — shared brand styles
 * Palette: Navy #0B1A2E, Gold #D4A754, Felt Green #0F4D3A, Off-white #F8F7F2
 */

.chipreign-tool {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
  color: #1a1a1a;
  max-width: 760px;
  margin: 2rem auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(11, 26, 46, 0.06);
  overflow: hidden;
}

.chipreign-tool__header {
  background: #0B1A2E;
  color: #F8F7F2;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #D4A754;
}

.chipreign-tool__badge {
  background: #D4A754;
  color: #0B1A2E;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-right: 0.75rem;
}

.chipreign-tool__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.chipreign-tool__subtitle {
  font-size: 0.85rem;
  color: rgba(248, 247, 242, 0.75);
  margin: 0.2rem 0 0;
}

.chipreign-tool__body {
  padding: 1.5rem;
  background: #F8F7F2;
}

.chipreign-tool__body--dark {
  background: #0B1A2E;
  color: #F8F7F2;
}

.chipreign-tool__section {
  margin-bottom: 1.25rem;
}

.chipreign-tool__section:last-child {
  margin-bottom: 0;
}

.chipreign-tool__field {
  display: block;
  margin-bottom: 1rem;
}

.chipreign-tool__field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0B1A2E;
  margin-bottom: 0.35rem;
}

.chipreign-tool__field input,
.chipreign-tool__field select,
.chipreign-tool__field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #cbd1d9;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #ffffff;
  box-sizing: border-box;
}

.chipreign-tool__field input:focus,
.chipreign-tool__field select:focus,
.chipreign-tool__field textarea:focus {
  outline: none;
  border-color: #D4A754;
  box-shadow: 0 0 0 3px rgba(212, 167, 84, 0.18);
}

.chipreign-tool__field--help {
  font-size: 0.78rem;
  color: #6B7280;
  margin-top: 0.25rem;
}

.chipreign-tool__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .chipreign-tool__grid {
    grid-template-columns: 1fr;
  }
}

.chipreign-tool__btn {
  display: inline-block;
  background: #D4A754;
  color: #0B1A2E;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.chipreign-tool__btn:hover,
.chipreign-tool__btn:focus {
  background: #c39434;
  outline: none;
}

.chipreign-tool__btn--secondary {
  background: transparent;
  color: #0B1A2E;
  border: 2px solid #0B1A2E;
}

.chipreign-tool__btn--secondary:hover {
  background: #0B1A2E;
  color: #F8F7F2;
}

.chipreign-tool__result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #ffffff;
  border-radius: 8px;
  border-left: 4px solid #D4A754;
}

.chipreign-tool__result-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6B7280;
  margin: 0 0 0.5rem;
}

.chipreign-tool__result-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0B1A2E;
  margin: 0;
  line-height: 1.1;
}

.chipreign-tool__result-subvalue {
  font-size: 0.9rem;
  color: #374151;
  margin: 0.3rem 0 0;
}

.chipreign-tool__result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.chipreign-tool__result-item {
  background: #f3f4f6;
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.chipreign-tool__result-item-label {
  font-size: 0.75rem;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.chipreign-tool__result-item-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0B1A2E;
  margin: 0.15rem 0 0;
}

.chipreign-tool__footer {
  background: #f0efe8;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.78rem;
  color: #6B7280;
  text-align: center;
}

.chipreign-tool__footer a {
  color: #0F4D3A;
  text-decoration: underline;
  font-weight: 600;
}

.chipreign-tool__alert {
  background: #fef3c7;
  border-left: 4px solid #d97706;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  font-size: 0.88rem;
  color: #78350f;
}

.chipreign-tool__alert--success {
  background: #d1fae5;
  border-color: #0F4D3A;
  color: #064e3b;
}

.chipreign-tool__alert--info {
  background: #e0f2fe;
  border-color: #0369a1;
  color: #0c4a6e;
}

.chipreign-tool__code {
  font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.85rem;
  background: #f3f4f6;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #0B1A2E;
  word-break: break-all;
}

.chipreign-tool__postcard-preview {
  background: #fdfbf5;
  border: 2px dashed #D4A754;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #1a1a1a;
}

.chipreign-tool__postcard-preview .chipreign-tool__postcard-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6B7280;
  display: block;
  margin-bottom: 0.5rem;
}

@media print {
  body * { visibility: hidden; }
  .chipreign-tool__postcard-print, .chipreign-tool__postcard-print * { visibility: visible; }
  .chipreign-tool__postcard-print { position: absolute; top: 0; left: 0; width: 100%; }
  .chipreign-tool__postcard-print .chipreign-tool__postcard-preview {
    border: 1px solid #000;
    page-break-after: always;
  }
}

/* Freshness Badge */
.chipreign-freshness {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.82rem;
  line-height: 1;
  border: 1px solid transparent;
  font-weight: 500;
}

.chipreign-freshness__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.chipreign-freshness__label {
  color: inherit;
  opacity: 0.8;
}

.chipreign-freshness__value {
  font-weight: 700;
}

.chipreign-freshness__absolute {
  opacity: 0.65;
  font-size: 0.76rem;
}

.chipreign-freshness--fresh {
  background: #d1fae5;
  color: #064e3b;
  border-color: #0F4D3A;
}
.chipreign-freshness--fresh .chipreign-freshness__dot {
  background: #0F4D3A;
}

.chipreign-freshness--acceptable {
  background: #fef3c7;
  color: #78350f;
  border-color: #D4A754;
}
.chipreign-freshness--acceptable .chipreign-freshness__dot {
  background: #D4A754;
}

.chipreign-freshness--stale {
  background: #fed7aa;
  color: #7c2d12;
  border-color: #ea580c;
}
.chipreign-freshness--stale .chipreign-freshness__dot {
  background: #ea580c;
}

.chipreign-freshness--very-stale {
  background: #fee2e2;
  color: #7f1d1d;
  border-color: #dc2626;
}
.chipreign-freshness--very-stale .chipreign-freshness__dot {
  background: #dc2626;
}

/* VPN Risk Dashboard */
.cr-vpn-verdict {
  padding: 1.25rem 1.5rem;
  border-left: 6px solid;
  border-radius: 8px;
  text-align: center;
}

.cr-vpn-verdict__tier-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.5rem;
}

.cr-vpn-verdict__tier {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.cr-vpn-verdict__desc {
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.9;
}

.cr-vpn-grid details.cr-vpn-row summary::-webkit-details-marker { display: none; }
.cr-vpn-grid details.cr-vpn-row summary::after {
  content: "+";
  font-size: 1.2rem;
  color: #6B7280;
  transition: transform 0.2s;
}
.cr-vpn-grid details.cr-vpn-row[open] summary::after {
  content: "\2212";
}
