/* ==========================================================================
   ConnTest Probe - Official Website Stylesheet
   Unified Design System (Matching manual.html & App Theme)
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #fff3e8;
  --surface: #fffaf5;
  --panel: #fffefd;
  --panel-alt: #f8eadc;
  --line: #dfc8b2;
  --line-strong: #b99470;
  --text: #2c261f;
  --muted: #6d5d4d;
  --primary: #f59e0b;
  --primary-strong: #d98200;
  --accent: #9a6500;
  --accent-bg: #fff4df;
  --success: #16a75f;
  --success-bg: #f2fbf6;
  --danger: #ca1f27;
  --danger-bg: #fff1ef;
  --warning: #91621e;
  --warning-bg: #fff8e9;
  --info: #087ca7;
  --info-bg: #edf8fc;

  --font-sans: "Segoe UI", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #000;
  text-decoration: underline;
}

.font-mono {
  font-family: var(--font-mono);
}

code {
  font-family: var(--font-mono);
  background: var(--panel-alt);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--line);
  font-size: 0.88em;
}

/* --------------------------------------------------------------------------
   Buttons & UI Elements (Matching manual.html)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.4;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary-strong);
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(185, 148, 112, 0.25);
}

.btn-primary:hover {
  background: var(--primary-strong);
  color: #fff !important;
}

.btn-outline {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--text) !important;
}

.btn-outline:hover {
  background: var(--panel-alt);
  border-color: var(--line-strong);
  color: var(--accent) !important;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.82rem;
  border-radius: 3px;
}

.btn-lg {
  padding: 11px 24px;
  font-size: 1rem;
}

.btn-xl {
  padding: 14px 28px;
  font-size: 1.05rem;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--accent-bg);
  border: 1px solid var(--line-strong);
  color: var(--accent);
  white-space: nowrap;
}

.chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.chip-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(22, 167, 95, 0.35);
}

.chip-warn {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(145, 98, 30, 0.35);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none !important;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav a:not(.btn) {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav a:not(.btn):hover {
  color: var(--accent);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}

.hero-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hero-header {
  max-width: 800px;
}

.hero-title {
  font-size: 2.3rem;
  line-height: 1.35;
  font-weight: 800;
  color: var(--text);
  margin: 16px 0 16px;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hero-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   App Preview Window (Matching manual.html & App Theme)
   -------------------------------------------------------------------------- */
.hero-preview {
  width: 100%;
}

.window-frame {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(99, 67, 36, 0.14);
  overflow: hidden;
}

.window-topbar {
  background: var(--panel-alt);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-close { background: #ca1f27; }
.dot-min { background: #d98200; }
.dot-max { background: #16a75f; }

.window-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.window-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22, 167, 95, 0.35);
  padding: 1px 8px;
  border-radius: 3px;
}

.window-content {
  padding: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.kpi-item {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
}

.kpi-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.text-success {
  color: var(--success);
}

.text-accent {
  color: var(--accent);
}

.stat-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}

.stat-pill.ok {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22, 167, 95, 0.35);
}

.stat-pill.warn {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(145, 98, 30, 0.35);
}

.auto-badge {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  margin-left: 4px;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 24px;
}

.hero-lead strong {
  color: var(--accent);
  font-size: 1.15rem;
}

/* --------------------------------------------------------------------------
   Pain Points Grid (現場の課題)
   -------------------------------------------------------------------------- */
.pain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.pain-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pain-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pain-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(202, 31, 39, 0.25);
  padding: 2px 8px;
  border-radius: 3px;
}

.pain-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.pain-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.pain-solution {
  background: var(--accent-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 0 4px 4px 0;
  padding: 10px 14px;
  margin-top: auto;
}

.sol-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.pain-solution p {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0;
}

.feature-tech-note {
  font-size: 0.76rem;
  color: var(--accent);
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 3px;
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Steps Grid (利用フロー)
   -------------------------------------------------------------------------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  position: relative;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.mock-table {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  font-size: 0.8rem;
}

.mock-thead {
  background: var(--panel-alt);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  color: var(--muted);
  display: grid;
  grid-template-columns: 2.5fr 1.6fr 1.6fr 1.4fr;
  padding: 8px 14px;
  font-size: 0.75rem;
}

.mock-row {
  display: grid;
  grid-template-columns: 2.5fr 1.6fr 1.6fr 1.4fr;
  padding: 9px 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.mock-row:last-child {
  border-bottom: none;
}

.row-highlight {
  background: var(--warning-bg);
}

.col-host {
  display: flex;
  flex-direction: column;
}

.host-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

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

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-success { background: var(--success); }
.dot-warn { background: var(--warning); }

.window-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--muted);
  padding: 4px 6px;
}

.status-text {
  font-weight: 600;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Sections & Headings
   -------------------------------------------------------------------------- */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.section-alt {
  background: var(--surface);
}

.section-header {
  margin-bottom: 36px;
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Features Grid (Matching manual.html card styling)
   -------------------------------------------------------------------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 4px 14px rgba(99, 67, 36, 0.08);
}

.feature-card-wide {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
}

.feature-card-wide .feature-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.feature-card-wide .feature-content {
  flex: 1;
}

.feature-card-wide .feature-name {
  margin-top: 2px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--accent-bg);
  border: 1px solid var(--line);
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.feature-text {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Comparison Table (Matching manual.html table-container)
   -------------------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(99, 67, 36, 0.05);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.table th, .table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  background: var(--panel-alt);
  font-weight: 700;
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: none;
}

.table .th-highlight {
  background: var(--accent-bg);
  border-bottom: 2px solid var(--primary);
  color: var(--accent);
}

.table .td-highlight {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Download Section (Matching manual.html callout & steps style)
   -------------------------------------------------------------------------- */
.download-card {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 36px 32px;
  box-shadow: 0 4px 16px rgba(99, 67, 36, 0.08);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.download-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.download-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin: 10px 0 6px;
}

.download-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.download-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.link-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

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

.download-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 4px;
}

.spec-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.spec-val {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--panel-alt);
  border-top: 1px solid var(--line);
  padding: 32px 0 24px;
  font-size: 0.84rem;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.footer-os-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border-left: 1px solid var(--line-strong);
  padding-left: 10px;
  font-weight: 500;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-note {
  font-size: 0.76rem;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.5;
}

.copyright {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Responsive Styles
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 680px) {
  .break-desktop {
    display: none;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .nav {
    display: none;
  }

  .feature-card-wide {
    flex-direction: column;
    gap: 14px;
  }

  .download-specs {
    grid-template-columns: 1fr;
  }

  .mock-thead, .mock-row {
    grid-template-columns: 1fr 1fr;
  }

  .col-route, .col-verdict {
    display: none;
  }

  .download-card {
    padding: 24px 18px;
  }

  .footer-top, .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
