/* ============================================================
   確認さん (Kakunin-san) — Non-Critical Stylesheet
   Loaded asynchronously via rel="preload".
   Critical CSS (variables, reset, header, hero, grid, ad-slot)
   is inlined in index.ejs <style> tag.
   ============================================================ */

/* ----------------------------------------------------------
   0. Global: ensure [hidden] always wins over display rules
   ---------------------------------------------------------- */
[hidden] {
  display: none !important;
}

/* ----------------------------------------------------------
   1. Glassmorphism
   ---------------------------------------------------------- */
.glassmorphism {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* ----------------------------------------------------------
   2. Header & Controls
   ---------------------------------------------------------- */
header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
}

.site-logo {
  text-decoration: none;
  color: var(--text-primary);
}

.site-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.header-btn:hover {
  background: var(--accent-light);
}





/* ----------------------------------------------------------
   3. Hero Section (enhancements beyond critical CSS)
   ---------------------------------------------------------- */
.hero-ip-wrapper,
.hero-geo,
.hero-gateway {
  margin-bottom: 0.75rem;
}

.hero-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.hero-geo-value {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
}

.hero-flag {
  font-size: 1.5rem;
}

.hero-location-text {
  font-weight: 500;
}

.hero-geo-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  font-weight: 400;
}

.hero-gateway-value {
  font-size: 1rem;
  word-break: break-all;
}

.hero-gateway-explanation {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.gateway-explanation-skeleton {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}

.gateway-explanation-skeleton .skeleton-bar {
  width: 200px;
  height: 0.8rem;
  background: var(--border);
  border-radius: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

.gateway-explanation-text {
  text-align: center;
}

/* ----------------------------------------------------------
   4. AI Summary Section
   ---------------------------------------------------------- */
.ai-summary {
  max-width: 800px;
  margin: 1.5rem auto;
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
}

.ai-summary h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.ai-icon {
  font-size: 1.25rem;
}

.ai-loading-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ai-typewriter-text {
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ----------------------------------------------------------
   5. Skeleton Loading
   ---------------------------------------------------------- */
.skeleton-line {
  height: 1rem;
  border-radius: 4px;
  background: var(--border);
  margin-bottom: 0.5rem;
}

.skeleton-line-short {
  width: 60%;
}

.skeleton-placeholder {
  display: inline-block;
  width: 100%;
}

.skeleton-bar {
  display: block;
  height: 0.875rem;
  width: 70%;
  border-radius: 4px;
  background: var(--border);
}

/* Pulse animation for skeletons */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ----------------------------------------------------------
   6. Info Cards
   ---------------------------------------------------------- */
.info-card {
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

/* Staggered card entrance — JS sets --card-index via animationEngine */
.info-card:nth-child(1)  { animation-delay: 0ms; }
.info-card:nth-child(2)  { animation-delay: 100ms; }
.info-card:nth-child(3)  { animation-delay: 200ms; }
.info-card:nth-child(4)  { animation-delay: 300ms; }
.info-card:nth-child(5)  { animation-delay: 400ms; }
.info-card:nth-child(6)  { animation-delay: 500ms; }

/* Priority border accents */
.info-card--high {
  border-left: 4px solid var(--accent);
}

.info-card--medium {
  border-left: 3px solid var(--text-secondary);
}

.info-card--low {
  border-left: 2px solid var(--border);
}

/* Category-specific border colors */
#card-network.info-card--high   { border-left-color: #3b82f6; } /* blue */
#card-browser-device.info-card--high { border-left-color: #22c55e; } /* green */
#card-hardware.info-card--medium { border-left-color: #a855f7; } /* purple */
#card-request.info-card--medium  { border-left-color: #f97316; } /* orange */
#card-proxy.info-card--low       { border-left-color: #6b7280; } /* gray */
#card-cookie.info-card--low      { border-left-color: #eab308; } /* yellow */

/* Hover effect */
.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

/* Card header */
.info-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.info-card__title {
  font-size: 1rem;
  font-weight: 600;
}

/* Card items (definition list) */
.info-card__items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-card__item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.info-card__item:last-child {
  border-bottom: none;
}

.info-card__label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 120px;
}

.info-card__value {
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-all;
  text-align: right;
  flex: 1;
  min-width: 0;
}

.info-card__value--fallback {
  color: #64748b;
  font-style: italic;
  font-size: 0.8rem;
}

[data-high-contrast="true"] .info-card__value--fallback {
  color: #d1d5db;
}

/* Monospace class (also in critical CSS, but full definition here) */
.mono {
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

/* ----------------------------------------------------------
   8. Footer
   ---------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  background: var(--bg-secondary);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-site-name {
  font-size: 1.125rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-link:hover {
  text-decoration: underline;
}



.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-attribution {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.maxmind-attribution {
  max-width: 600px;
  line-height: 1.5;
}

/* ----------------------------------------------------------
   9. Privacy Page
   ---------------------------------------------------------- */
.privacy-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.privacy-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.privacy-last-updated {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.privacy-page section {
  margin-bottom: 2rem;
}

.privacy-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.privacy-page p {
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ----------------------------------------------------------
   10. Error Page (supplements inline critical styles)
   ---------------------------------------------------------- */
.error-page {
  padding: 3rem 1.5rem;
}

/* ----------------------------------------------------------
   12. Offline Banner
   ---------------------------------------------------------- */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: #f59e0b;
  color: #78350f;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ----------------------------------------------------------
   13. Change Badge (visit history comparison)
   ---------------------------------------------------------- */
.change-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 0.5rem;
  vertical-align: middle;
  transition: background-color 0.2s;
}

.change-badge:hover {
  background: #fde68a;
}

/* ----------------------------------------------------------
   15. Keyframe Animations
   ---------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------------------------
   16. Focus Indicators (Accessibility)
   ---------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ----------------------------------------------------------
   16b. Skip to Content Link (Accessibility)
   ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ----------------------------------------------------------
   17. Prefers Reduced Motion
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .info-card {
    opacity: 1;
  }

  .info-card:hover {
    transform: none;
  }

  .pulse {
    animation: none;
  }
}

/* ----------------------------------------------------------
   18. High Contrast Mode
   ---------------------------------------------------------- */
[data-high-contrast="true"] {
  --bg-primary: #000000;
  --bg-secondary: #111111;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --accent: #66b3ff;
  --accent-light: #003366;
  --border: #555555;
  --glass-bg: rgba(0, 0, 0, 0.9);
  --glass-border: rgba(100, 100, 100, 0.5);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

[data-high-contrast="true"] .info-card {
  border-width: 3px;
}

[data-high-contrast="true"] .info-card--high {
  border-left-width: 5px;
}

[data-high-contrast="true"] .header-btn {
  border-width: 2px;
}

[data-high-contrast="true"] a {
  text-decoration: underline;
}

/* ----------------------------------------------------------
   19. Ad Slot Enhancements (CLS prevention)
   ---------------------------------------------------------- */
.ad-slot ins {
  display: block;
  min-height: inherit;
}

/* ----------------------------------------------------------
   20. Responsive Tweaks
   ---------------------------------------------------------- */
@media (max-width: 767px) {
  header nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-controls {
    width: 100%;
    justify-content: center;
  }

  .hero-ip {
    font-size: 1.5rem;
  }

  .ai-summary {
    margin: 1rem;
  }

  .info-card__item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .info-card__value {
    text-align: left;
  }

  .info-card__label {
    min-width: auto;
  }

}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-ip {
    font-size: 2rem;
  }
}

/* ----------------------------------------------------------
   21. Fingerprint Uniqueness Score
   Requirements: 4.1, 4.2, 4.4, 4.7, 9.1, 9.2, 9.4, 9.5, 9.6
   ---------------------------------------------------------- */

/* Section layout */
.fingerprint-section {
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Summary card */
.fingerprint-summary {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 100ms;
}

.fingerprint-summary__content {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 0;
}

.fingerprint-summary__chart {
  flex-shrink: 0;
}

.fingerprint-summary__details {
  flex: 1;
  min-width: 0;
}

/* Donut chart (SVG) */
.fingerprint-donut {
  width: 140px;
  height: 140px;
  position: relative;
}

.fingerprint-donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.fingerprint-donut__bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.fingerprint-donut__progress {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease, stroke 0.3s;
}

.fingerprint-donut__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.fingerprint-donut__score {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.fingerprint-donut__percent {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Risk level colors */
.fingerprint-risk--low { color: #22c55e; }
.fingerprint-risk--medium { color: #eab308; }
.fingerprint-risk--high { color: #f97316; }

.fingerprint-risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.fingerprint-risk-badge--low {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.fingerprint-risk-badge--medium {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.fingerprint-risk-badge--high {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.fingerprint-risk-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  line-height: 1.6;
}

.fingerprint-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.fingerprint-meta__item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Contribution bars */
.fingerprint-contribution {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 200ms;
}

.fingerprint-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fingerprint-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fingerprint-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8rem;
}

.fingerprint-bar-name {
  font-weight: 500;
  color: var(--text-primary);
}

.fingerprint-bar-value {
  color: var(--text-secondary);
  font-size: 0.75rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fingerprint-bar-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.fingerprint-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.fingerprint-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.fingerprint-bar-fill--low { background: #22c55e; }
.fingerprint-bar-fill--medium { background: #eab308; }
.fingerprint-bar-fill--high { background: #f97316; }

.fingerprint-bar-level {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.fingerprint-bar-level--low { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.fingerprint-bar-level--medium { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.fingerprint-bar-level--high { background: rgba(249, 115, 22, 0.15); color: #f97316; }

/* Recommendations */
.fingerprint-recommendations {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 300ms;
}

.fingerprint-rec-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fingerprint-rec-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  transition: background-color 0.3s;
}

.fingerprint-rec-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.fingerprint-rec-content {
  flex: 1;
  min-width: 0;
}

.fingerprint-rec-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.fingerprint-rec-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Noscript message */
.fingerprint-section .noscript-message {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem;
}

/* Dark mode transitions (300ms) */
.fingerprint-summary,
.fingerprint-contribution,
.fingerprint-recommendations,
.fingerprint-rec-item,
.fingerprint-bar-fill {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Responsive: mobile */
@media (max-width: 767px) {
  .fingerprint-section {
    padding: 0 1rem;
  }

  .fingerprint-summary__content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .fingerprint-donut {
    width: 120px;
    height: 120px;
  }

  .fingerprint-donut__score {
    font-size: 1.5rem;
  }

  .fingerprint-meta {
    justify-content: center;
  }

  .fingerprint-bar-header {
    flex-direction: column;
    gap: 0.15rem;
  }

  .fingerprint-bar-value {
    max-width: 100%;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fingerprint-summary,
  .fingerprint-contribution,
  .fingerprint-recommendations {
    opacity: 1;
    animation: none;
  }

  .fingerprint-donut__progress {
    transition: none;
  }

  .fingerprint-bar-fill {
    transition: none;
  }
}

/* ----------------------------------------------------------
   23. Security Score Dashboard
   ---------------------------------------------------------- */

/* Dashboard card */
.security-dashboard {
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 50ms;
}

/* Gauge */
.security-gauge-container {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.security-gauge {
  width: 200px;
  height: 120px;
}

.security-gauge-arc {
  transition: stroke-dashoffset 0.5s ease-out;
}

.security-gauge-score {
  font-size: 2rem;
  font-weight: 700;
  fill: var(--text-primary);
}

.security-gauge-label {
  font-size: 0.875rem;
  fill: var(--text-secondary);
}

.security-gauge-skeleton {
  display: flex;
  justify-content: center;
  min-height: 120px;
}

/* Factor list */
.security-factors {
  display: flex;
  flex-direction: column;
}

.security-factor {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.security-factor:last-child {
  border-bottom: none;
}

.security-factor-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.security-factor-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.85rem;
}

.security-factor-score {
  font-weight: 700;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 0.85rem;
}

.security-factor-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.25rem 0;
}

.security-factor-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.security-factor-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.25rem;
}

.security-factors-skeleton {
  min-height: 60px;
}

/* Status colors */
.security-factor-status { font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.4rem; border-radius: 4px; }
.security-factor-status--pass { color: #22c55e; background: rgba(34, 197, 94, 0.15); }
.security-factor-status--warning { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }
.security-factor-status--fail { color: #ef4444; background: rgba(239, 68, 68, 0.15); }

.security-factor-bar-fill--pass { background: #22c55e; }
.security-factor-bar-fill--warning { background: #f59e0b; }
.security-factor-bar-fill--fail { background: #ef4444; }

/* Recommendations */
.security-recommendations {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.security-recommendations-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.security-recommendations-allpass {
  font-size: 0.85rem;
  color: #22c55e;
  line-height: 1.6;
}

.security-recommendation {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.security-recommendation-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}

.security-recommendation-content {
  flex: 1;
  min-width: 0;
}

.security-recommendation-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.security-recommendation-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Dark/light mode transitions */
.security-dashboard,
.security-factor,
.security-recommendation {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Responsive: mobile */
@media (max-width: 767px) {
  .security-dashboard {
    margin: 1rem;
    padding: 1rem;
  }

  .security-gauge {
    width: 160px;
    height: 100px;
  }

  .security-factor-header {
    flex-wrap: wrap;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .security-dashboard {
    opacity: 1;
    animation: none;
  }

  .security-gauge-arc {
    transition: none;
  }

  .security-factor-bar-fill {
    transition: none;
  }
}

/* ----------------------------------------------------------
   25. Article Pages & Static Pages
   ---------------------------------------------------------- */
.article-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.article-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.article-lead {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.article-page section {
  margin-bottom: 2.5rem;
}

.article-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent);
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--accent-light);
}

.article-page h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.article-page p {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.article-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-page a:hover {
  opacity: 0.8;
}

.article-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-list li {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.article-page ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-page ol li {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.article-page ul:not(.article-list) {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-page ul:not(.article-list) li {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.article-page code {
  background: var(--accent-light);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
}

.article-note {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 1rem;
  background: var(--accent-light);
  border-radius: 8px;
  line-height: 1.6;
}

/* Article detail */
.article-breadcrumb {
  margin-bottom: 1.5rem;
}

.article-breadcrumb a {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-detail__header {
  margin-bottom: 2rem;
}

.article-detail__date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.article-body section {
  margin-bottom: 2.5rem;
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent);
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--accent-light);
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.article-body p {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-body li {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.article-body code {
  background: var(--accent-light);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
}

/* Article card grid (index page) */
.article-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.article-card {
  display: block;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.article-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.article-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.article-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.article-card__readmore {
  color: var(--accent);
  font-weight: 500;
}

/* Contact page */
.contact-form-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.75rem;
}

.contact-form-link a {
  color: var(--accent);
  font-weight: 600;
}

.contact-form-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.contact-github-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.75rem;
}

.contact-github-link a {
  color: var(--accent);
  font-weight: 600;
}

/* Footer links enhancement */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 767px) {
  .article-page {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }

  .article-page h1 {
    font-size: 1.35rem;
  }

  .contact-form-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

/* ===========================
   IP Copy Button
   =========================== */
.ip-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  vertical-align: middle;
}

.ip-copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.ip-copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ip-copy-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ネットワークカード内のインラインコピーボタン */
.ip-copy-btn--inline {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin-left: 0.5rem;
}

.ip-copy-btn--inline svg {
  width: 14px;
  height: 14px;
}

/* ヒーローセクションのIPアドレス行 */
.hero-ip-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* ----------------------------------------------------------
   27. Accordion for Recommendation Details
   Requirements: 3.1, 3.2, 3.3, 3.4
   ---------------------------------------------------------- */
.recommendation-accordion-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: var(--bg-secondary);
}

.accordion-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  gap: 0.75rem;
  font: inherit;
  color: inherit;
  transition: background-color 0.2s;
}

.accordion-trigger:hover {
  background: var(--accent-light, rgba(59, 130, 246, 0.08));
}

.accordion-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.accordion-indicator {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.accordion-indicator--open {
  transform: rotate(90deg);
}

.accordion-panel {
  overflow: hidden;
}

.accordion-detail {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}

.detail-section {
  margin-top: 0.75rem;
}

.detail-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.detail-section p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.detail-article-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.detail-article-link:hover {
  text-decoration: underline;
}

.rec-summary {
  flex: 1;
  min-width: 0;
}

.rec-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.rec-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.rec-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   Gateway Explanation
   ---------------------------------------------------------- */
.hero-gateway-explanation {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
  min-height: 1.2em;
}

.gateway-explanation-skeleton {
  display: inline-block;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
  color: transparent;
  user-select: none;
}

.gateway-explanation-text {
  line-height: 1.4;
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----------------------------------------------------------
   28. Tooltips for Technical Terms
   ---------------------------------------------------------- */
.tooltip-trigger {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-secondary);
}

.tooltip-trigger .tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: max-content;
  max-width: 280px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.75rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip-trigger .tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-primary);
}

.tooltip-trigger:hover .tooltip-content,
.tooltip-trigger:focus-within .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* Mobile: show tooltip below */
@media (max-width: 767px) {
  .tooltip-trigger .tooltip-content {
    bottom: auto;
    top: calc(100% + 8px);
    left: 0;
    transform: none;
    max-width: 240px;
  }

  .tooltip-trigger .tooltip-content::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--text-primary);
    left: 16px;
    transform: none;
  }
}

/* ----------------------------------------------------------
   29. Toast Notification
   ---------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  animation: toastIn 0.25s ease forwards;
}

.toast--exit {
  animation: toastOut 0.2s ease forwards;
}

.toast__icon {
  font-size: 1rem;
  flex-shrink: 0;
}

@keyframes toastIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .toast--exit {
    animation: none;
  }
}

/* ----------------------------------------------------------
   30. Scroll Progress Bar
   ---------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 150;
  transition: none;
  pointer-events: none;
}

/* ----------------------------------------------------------
   31. will-change Hints for Animated Elements
   ---------------------------------------------------------- */
.info-card {
  will-change: transform, box-shadow;
}

.fingerprint-summary,
.fingerprint-contribution,
.fingerprint-recommendations,
.security-dashboard {
  will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
  .info-card,
  .fingerprint-summary,
  .fingerprint-contribution,
  .fingerprint-recommendations,
  .security-dashboard {
    will-change: auto;
  }
}

/* ----------------------------------------------------------
   32. Focus Visibility — Dark Mode & High Contrast Enhancement
   ---------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :focus-visible {
    outline-color: #93c5fd;
  }
}

[data-high-contrast="true"] :focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
}

/* ----------------------------------------------------------
   33. Individual Collector Loading Micro-States
   ---------------------------------------------------------- */
.collector-loading-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: collectorPulse 1s ease-in-out infinite;
  margin-right: 0.35rem;
  vertical-align: middle;
}

@keyframes collectorPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.collector-done .collector-loading-dot {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .collector-loading-dot {
    animation: none;
    opacity: 1;
  }
}

/* ----------------------------------------------------------
   34. Contact Form
   Requirements: 1.1, 1.2, 1.3, 1.4, 4.1, 8.1
   ---------------------------------------------------------- */

/* Form layout */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* Field group */
.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-form__field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Input, select, textarea shared styles */
.contact-form__field input[type="text"],
.contact-form__field input[type="email"],
.contact-form__field select,
.contact-form__field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form__field input:focus,
.contact-form__field select:focus,
.contact-form__field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.contact-form__field input[aria-invalid="true"],
.contact-form__field select[aria-invalid="true"],
.contact-form__field textarea[aria-invalid="true"] {
  border-color: #ef4444;
}

.contact-form__field textarea {
  resize: vertical;
  min-height: 120px;
}

/* Error message */
.contact-form__error {
  font-size: 0.8rem;
  color: #ef4444;
  min-height: 1.2em;
  line-height: 1.4;
}

/* General error (top of form) */
.contact-form__general-error {
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
}

/* Success message */
.contact-form__success {
  padding: 1rem 1.25rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  color: #16a34a;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
}

/* Honeypot (hidden from real users) */
.contact-honeypot {
  display: none;
}

/* Meta row (error + char count) */
.contact-form__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

/* Character counter */
.contact-form__char-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Actions row */
.contact-form__actions {
  display: flex;
  justify-content: flex-end;
}

/* Submit button */
.contact-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, opacity 0.2s;
  min-width: 120px;
}

.contact-form__submit:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.contact-form__submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive: mobile */
@media (max-width: 767px) {
  .contact-form {
    padding: 1rem;
    gap: 1rem;
  }

  .contact-form__meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  .contact-form__submit {
    width: 100%;
  }
}

/* Dark/light mode transitions */
.contact-form,
.contact-form__success {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* ----------------------------------------------------------
   27. Article Promotion Section (Top Page)
   ---------------------------------------------------------- */
.article-promotion {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.article-promotion__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.article-promotion__header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.article-promotion__view-all {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}

.article-promotion__view-all:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .article-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .article-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
