/* Smart Doctor Pro unified PC/SP responsive foundation.
   Load after styles.css and before page-specific overrides. */
:root {
  --sdp-shell: 1180px;
  --sdp-gutter: 24px;
  --sdp-gutter-sp: 16px;
  --sdp-brand: #a34f4d;
  --sdp-brand-dark: #803d3c;
  --sdp-ink: #262729;
  --sdp-muted: #66686c;
  --sdp-line: #e3dfdc;
  --sdp-paper: #fff;
  --sdp-soft: #f6f4f2;
}

html {
  overflow-x: hidden;
  color: var(--sdp-ink);
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  overflow-x: hidden;
  line-height: 1.75;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

img,
picture,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

a,
button,
summary {
  touch-action: manipulation;
}

.shell {
  width: calc(100% - 48px);
  max-width: var(--sdp-shell);
  margin-right: auto;
  margin-left: auto;
}

.content-narrow {
  width: calc(100% - 48px);
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}

.site-header,
.site-footer,
.primary-nav,
main,
section,
article {
  min-width: 0;
}

.brand-logo {
  width: 300px;
  max-width: 300px;
  height: auto;
}

.brand strong,
.eyebrow,
.feature-label,
.trust-grid b,
.column-title span,
.estimate-dock-item small {
  letter-spacing: 0;
}

.hero h1 {
  font-size: 56px;
  line-height: 1.22;
  letter-spacing: 0;
}

.section-heading h2,
.final-cta h2 {
  font-size: 38px;
  line-height: 1.35;
  letter-spacing: 0;
}

.feature-card h2,
.method-grid h3 {
  font-size: 32px;
  line-height: 1.38;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
p,
li,
dt,
dd,
th,
td,
a,
button,
summary {
  overflow-wrap: anywhere;
}

.button,
.button-outline,
.button-primary,
.button-secondary,
.menu-button,
.intent-grid a,
.price-grid a,
.feature-card,
.feature-corporate,
.feature-card__banner img,
.method-grid article,
.trust-grid article,
.voice-grid article,
.media-grid article,
.news-layout,
.faq-list,
.mobile-sitemap section,
.mobile-sitemap a,
.mobile-model-accordion,
.estimate-modal,
.estimate-option,
.estimate-result-actions a {
  border-radius: 8px;
}

.primary-nav .shell,
.device-entry nav,
.intent-grid,
.price-grid,
.feature-grid,
.repair-grid,
.method-grid,
.trust-grid,
.voice-grid,
.media-grid,
.knowledge-columns,
.symptom-grid,
.footer-grid,
.footer-sitemap {
  min-width: 0;
}

.device-entry a,
.intent-grid a,
.price-grid a,
.repair-grid a,
.method-grid article,
.trust-grid article,
.voice-grid article,
.media-grid article,
.symptom-grid a,
.news-list a,
.footer-sitemap a {
  min-width: 0;
}

.hero-copy,
.feature-card,
.feature-corporate .feature-card__body,
.method-grid article,
.news-list,
.final-cta,
.footer-grid,
.footer-sitemap {
  min-width: 0;
}

.hero-actions,
.trust-actions,
.final-cta > .shell > div {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions .button,
.trust-actions .button,
.final-cta .button {
  flex: 0 1 auto;
}

.primary-nav a,
.device-entry a,
.intent-grid a,
.price-grid a,
.repair-grid a,
.symptom-grid a,
.footer-sitemap a,
.mobile-sitemap a {
  text-decoration: none;
}

.primary-nav a:focus-visible,
.button:focus-visible,
.menu-button:focus-visible,
.footer-sitemap a:focus-visible,
.mobile-sitemap a:focus-visible {
  outline: 3px solid rgba(163, 79, 77, .32);
  outline-offset: 3px;
}

.is_pc,
.is_sp {
  min-width: 0;
}

@media (max-width: 1180px) {
  .primary-nav .shell {
    grid-template-columns: repeat(4, 1fr);
  }

  .primary-nav a:last-child {
    grid-column: span 4;
  }

  .device-entry {
    grid-template-columns: 1fr;
  }

  .device-entry nav {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 960px) {
  .utility,
  .header-actions {
    display: none;
  }

  .header-main {
    min-height: 72px;
  }

  .brand-logo {
    width: 220px;
    max-width: 220px;
  }

  .menu-button {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--sdp-brand);
    color: var(--sdp-brand-dark);
    background: #fff;
    font-size: 11px;
    font-weight: 900;
  }

  .primary-nav {
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    z-index: 1000;
    display: none;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 34px rgba(44, 42, 43, .14);
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav .shell {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .primary-nav a {
    min-height: 54px;
    padding: 11px 8px;
    border-right: 1px solid var(--sdp-line);
    border-bottom: 1px solid var(--sdp-line);
    font-size: 12px;
  }

  .primary-nav a:nth-child(2n) {
    border-right: 0;
  }

  .primary-nav a:last-child {
    grid-column: 1 / -1;
  }

  .hero {
    min-height: 0;
  }

  .hero-inner {
    min-height: 0;
  }

  .hero-copy {
    width: 100%;
  }

  .hero h1 {
    font-size: 38px;
  }

  .section-heading h2,
  .final-cta h2 {
    font-size: 30px;
  }

  .feature-card h2,
  .method-grid h3 {
    font-size: 26px;
  }

  .intent-grid,
  .price-grid,
  .repair-grid,
  .trust-grid,
  .voice-grid,
  .media-grid,
  .symptom-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-grid,
  .method-grid,
  .knowledge-columns,
  .news-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .news-list a {
    grid-template-columns: 90px 1fr;
  }

  .news-list strong {
    grid-column: 1 / -1;
  }

  .footer-sitemap {
    grid-template-columns: 1fr;
  }

  .footer-sitemap summary {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 15px 2px;
    cursor: pointer;
  }

  .footer-sitemap summary::after {
    content: "+";
    color: #fff;
    font-weight: 900;
  }

  .footer-sitemap .fmap[open] summary::after {
    content: "-";
  }
}

@media (max-width: 620px) {
  .shell,
  .content-narrow {
    width: calc(100% - 32px);
  }

  .brand-logo {
    width: 196px;
    max-width: 196px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .section-heading h2,
  .final-cta h2 {
    font-size: 25px;
  }

  .feature-card h2,
  .method-grid h3 {
    font-size: 23px;
  }

  .hero-actions,
  .trust-actions,
  .final-cta > .shell > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button,
  .hero-actions .button,
  .trust-actions .button,
  .final-cta .button {
    width: 100%;
  }

  .intent-grid,
  .trust-grid,
  .voice-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }
  .repair-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* 「主な修理料金」もスマホ2列 */
  .price-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* 「症状からすぐ探す（どの修理が必要ですか？）」もスマホ2列 */
  .symptom-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* 「対応端末から探す」はスマホでも2列。連結グリッドの区切り線/最終行を調整。 */
  .device-entry nav {
    grid-template-columns: 1fr 1fr;
  }
  .device-entry nav a {
    border-bottom: 1px solid var(--brand);
  }
  .device-entry nav a:nth-child(2n) {
    border-right: 0 !important;
  }
  .device-entry nav a:nth-child(5) {
    grid-column: 1 / -1;
    border-right: 0 !important;
    border-bottom: 0;
  }

  .feature-card,
  .method-grid article,
  .voice-grid article,
  .media-grid article {
    padding: 24px;
  }

  .news-list {
    padding: 8px 16px;
  }

  .news-list a {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (min-width: 961px) {
  .menu-button {
    display: none;
  }

  .primary-nav {
    display: block;
  }

  .footer-sitemap .fmap {
    display: block;
  }

  .footer-sitemap .fmap-links {
    display: flex;
  }

  .footer-sitemap summary {
    pointer-events: none;
  }
}

/* 幅の広い表はSP/タブレットで枠内横スクロール（min-width等で膨張して切れるのを防ぐ・サイト全体） */
@media (max-width: 820px) {
  .legacy-restored-content table,
  .service-main table,
  .blog-content table {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}
