/* Extracted CSS from app/server.js for better code quality and mobile styling */
:root {
  /* Dark body theme */
  --bg: #0a0f1c;
  --panel: #11192d;
  --line: #223250;
  --text: #edf2fb;
  --muted: #b8c4d9;
  --accent: #7db5ff;
  --accent-strong: #9bd0ff;
  --good: #8be0a7;
  --warn: #ffd37a;

  /* Nav design tokens (light / Stripe-Linear aesthetic) */
  --nav-bg: #FFFFFF;
  --nav-height: 60px;
  --nav-border: #E5E7EB;
  --nav-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

  /* Nav text */
  --nav-text: #374151;
  --nav-text-hover: #111827;
  --nav-text-active: #1A3D6E;

  /* Brand colours */
  --color-primary: #1A3D6E;
  --color-accent: #00C27C;
  --color-cta: #1A3D6E;
  --color-cta-hover: #142F57;

  /* Misc */
  --radius-btn: 6px;
  --radius-dropdown: 8px;
  --font-nav: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Top Nav ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  font-family: var(--font-nav);
}
.topbar.scrolled { box-shadow: var(--nav-shadow); }

.topbar__inner {
  display: flex;
  align-items: center;
  height: var(--nav-height);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 32px;
}

/* Logo */
.topbar__logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  height: 36px;
  width: auto;
  display: block;
}

/* Nav links */
.topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--nav-text);
  text-decoration: none;
  border-radius: 6px;
  position: relative;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--nav-text-hover);
  background: #F3F4F6;
}
.nav-link.active {
  color: var(--nav-text-active);
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -19px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
}

/* Actions */
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.btn-cta {
  background: var(--color-cta);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-cta:hover { background: var(--color-cta-hover); }

.icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: #6B7280;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: #F3F4F6; }

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

/* Mobile */
.hamburger { display: none; }

@media (max-width: 768px) {
  .topbar__nav { display: none; flex-direction: column; gap: 10px; background: var(--nav-bg); position: absolute; top: 60px; left: 0; right: 0; padding: 12px 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 99; }
  .btn-cta-label { display: none; }
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
  }
  .hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #374151;
    border-radius: 2px;
  }
}

/* ── Body / Page Theme (Dark) ── */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-nav);
  background: linear-gradient(180deg, #09101d 0%, #0c1324 100%);
  color: var(--text);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.hero {
  padding: 28px 0 14px;
}

.hero h1 {
  font-size: 52px;
  line-height: 1.02;
  margin: 0 0 12px;
  max-width: 820px;
}

.hero p {
  max-width: 780px;
  font-size: 18px;
  color: var(--muted);
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn {
  display: inline-block;
  border-radius: 12px;
  padding: 13px 18px;
  text-decoration: none;
  font-weight: 700;
}

.btn.primary {
  background: var(--accent);
  color: #07101f;
}

.btn.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.card {
  background: rgba(17, 25, 45, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.search-shell {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.search-row-1 {
  display: flex;
  gap: 0;
  width: 100%;
}

.search-input {
  flex-grow: 1;
  font-size: 18px;
  padding: 14px 18px;
  border-radius: 12px 0 0 12px;
  border: 1px solid var(--line);
  background: #0c1529;
  color: var(--text);
  min-width: 220px;
  outline-offset: 2px;
}

.search-button {
  padding: 14px 22px;
  font-size: 18px;
  border-radius: 0 12px 12px 0;
  border: 1px solid var(--line);
  border-left: none;
  background: var(--accent);
  color: #07101f;
  cursor: pointer;
  transition: background 0.15s;
}

.search-button:hover {
  background: var(--accent-strong);
}

.search-row-2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

select {
  background: #0c1529;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
  min-width: 100%;
  cursor: pointer;
}

.clear-button {
  grid-column: span 1;
  margin-left: auto;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
}

.results {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.result-card {
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 0.15s ease-in-out;
}

.result-card:focus,
.result-card:hover {
  box-shadow: 0 0 8px var(--accent);
  outline: none;
}

.result-info {
  flex: 1 1 auto;
  overflow-wrap: break-word;
}

.contractor-name {
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 0 6px 0;
  color: var(--text);
}

.result-trade-location {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.result-license {
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--muted);
}

.license-number {
  font-family: monospace;
  font-weight: 600;
  margin-right: 6px;
}

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: capitalize;
  border: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  cursor: default;
}

.pill.good {
  color: var(--good);
  border-color: var(--good);
  background-color: rgba(139, 224, 167, 0.15);
}

.pill.warn {
  color: var(--warn);
  border-color: var(--warn);
  background-color: rgba(255, 211, 122, 0.15);
}

.muted {
  color: var(--muted);
}

.result-meta {
  font-size: 0.75rem;
  margin-top: 6px;
  color: var(--muted);
}

.license-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--accent-strong);
  border-radius: 9999px;
  border: 1px solid var(--accent-strong);
  background: transparent;
  margin-left: 6px;
  vertical-align: middle;
}

.result-action {
  margin-left: 30px;
  align-self: center;
}

.btn.ghost {
  background: none;
  border: 1px solid var(--accent-strong);
  color: var(--accent-strong);
  cursor: pointer;
  padding: 10px 18px;
  font-size: 0.9rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn.ghost:hover {
  background-color: var(--accent-strong);
  color: var(--bg);
  text-decoration: none;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.6rem;
}

.pagination span {
  font-weight: 600;
  color: var(--muted);
}

.pagination .btn {
  padding: 8px 20px;
  border-radius: 12px;
  background-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.pagination .btn:hover {
  background-color: var(--accent-strong);
}

/* Result count summary */
.result-count {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Start追加 CSS for visual polish and layout fixes */

/* Two columns for profile cards - side by side on desktop, stacked on mobile */
.two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.two-col > * {
  flex: 1 1 calc(50% - 16px);
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .two-col {
    flex-direction: column;
  }
  .two-col > * {
    flex: 1 1 100%;
  }
}

/* Eyebrow style - small pre-heading text */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

/* Key-value item style for labeled metadata */
.kv {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.kv span {
  font-weight: 600;
  color: var(--text);
}

/* Section title style - larger, bold, with bottom margin */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 12px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
}

/* No results message style - centered, muted text */
.no-results {
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  margin: 24px 0;
}

/* Profile status pill badge */
.profile-status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  background-color: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: capitalize;
  margin-left: 8px;
}

/* Muted profile status style for less prominent info */
.profile-status-muted {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Preserve existing mobile styles after additions */
@media (max-width: 640px) {
  .search-shell {
    margin-top: 0;
    display: block;
  }
  .search-row-1 {
    display: flex;
    margin-bottom: 12px;
  }
  .search-input {
    flex-grow: 1;
    font-size: 16px;
    padding: 12px 14px;
  }
  .search-button {
    padding: 12px 18px;
    font-size: 16px;
  }
  .search-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;  
  }
  .search-shell select, .search-shell .clear-button {
    width: 100%;
  }
  .result-card {
    flex-direction: column;
    margin-bottom: 18px;
  }
  .result-action {
    margin-left: 0;
    margin-top: 10px;
    text-align: right;
  }
}
/* End追加 CSS */
