/*
Theme Name: Miengena Renewal
Theme URI: https://www.miengena.com/
Author: OpenAI
Author URI: https://www.miengena.com/
Description: ミエンゲナの全面リニューアル用クラシックWordPressテーマ。紙・カード・インデックスを思わせる物理的なUIと、スマートフォン向けアプリ風ナビゲーション、アクセシビリティ機能、SEO/構造化データ機能を備えます。
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: miengena-base
*/

:root {
  --desk: #d8d0c0;
  --desk-deep: #c7bdab;
  --paper: #fffdf6;
  --paper-2: #f7f1e4;
  --paper-3: #eee5d2;
  --ink: #1e2930;
  --muted: #5d676b;
  --line: #c9bda6;
  --line-dark: #887c68;
  --accent: #1d6678;
  --accent-deep: #154b58;
  --accent-soft: #dcedef;
  --warm: #c96f45;
  --warm-soft: #f6dfd3;
  --success: #2e6d53;
  --focus: #ffbf47;
  --white: #ffffff;
  --max: 1120px;
  --radius: 18px;
  --radius-small: 12px;
  --shadow-paper: 0 2px 0 rgba(93, 79, 57, .14), 0 12px 30px rgba(72, 59, 39, .12);
  --shadow-card: 0 3px 0 #b7aa93, 0 9px 20px rgba(69, 55, 36, .14);
  --shadow-press: 0 1px 0 #ab9d85, 0 3px 8px rgba(69, 55, 36, .12);
  --mobile-nav-h: 76px;
}

html {
  box-sizing: border-box;
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,.08)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 7px),
    var(--desk);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 18px;
  line-height: 1.85;
  word-break: normal;
  overflow-wrap: anywhere;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(76,62,43,.08) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.28) 0 1px, transparent 1.5px);
  background-size: 13px 13px, 17px 17px;
  z-index: -1;
}

a { color: var(--accent-deep); text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 3px; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.screen-reader-text:focus,
.skip-link:focus {
  clip: auto !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: .8rem 1rem !important;
  background: #000 !important;
  color: #fff !important;
  top: .75rem !important;
  left: .75rem !important;
  z-index: 10000 !important;
  white-space: normal !important;
}

:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }

.wrap { width: min(calc(100% - 32px), var(--max)); margin-inline: auto; }

/* Header / app bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255,253,246,.96);
  border-bottom: 1px solid rgba(136,124,104,.65);
  box-shadow: 0 5px 18px rgba(62,50,31,.11);
  backdrop-filter: blur(12px);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .65rem;
}
.site-branding { display: flex; align-items: center; min-width: 0; gap: .8rem; }
.site-logo img { display: block; max-height: 48px; width: auto; }
.site-branding__text { min-width: 0; }
.site-title { margin: 0; font-size: 1.4rem; line-height: 1.2; letter-spacing: .03em; font-weight: 900; }
.site-title a { color: var(--ink); text-decoration: none; }
.site-description { margin: .2rem 0 0; max-width: 38rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.header-actions { display: flex; align-items: center; gap: .45rem; flex: 0 0 auto; }
.tool-button {
  appearance: none;
  min-height: 44px;
  border: 1px solid var(--line-dark);
  border-bottom-width: 3px;
  border-radius: 12px;
  padding: .55rem .8rem;
  color: var(--ink);
  background: var(--paper);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(84,68,45,.09);
}
.tool-button:hover { transform: translateY(-1px); }
.tool-button:active { transform: translateY(1px); border-bottom-width: 1px; }
.tool-button[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.tool-button--menu { color: #fff; background: var(--accent); border-color: var(--accent-deep); }

.nav-shell { border-top: 1px dashed rgba(136,124,104,.42); }
.primary-nav { padding: .55rem 0 .65rem; }
.primary-nav ul { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: .35rem .85rem;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px 10px 5px 5px;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(112,95,67,.12);
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }

/* Page frame */
.site-main { padding: 2rem 0 4.8rem; }
.breadcrumbs {
  margin: 0 0 1rem;
  padding: .65rem .9rem;
  background: rgba(255,253,246,.72);
  border: 1px solid rgba(136,124,104,.45);
  border-radius: 10px;
  font-size: .88rem;
  color: var(--muted);
}
.breadcrumbs a { color: inherit; }

.entry,
.widget {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-paper);
}
.entry::after {
  content: "";
  position: absolute;
  left: 1.2rem;
  right: 1.2rem;
  bottom: -.42rem;
  height: .42rem;
  z-index: -1;
  border: 1px solid rgba(136,124,104,.45);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #eee3ce;
}
.entry { padding: clamp(1.2rem, 3vw, 2.35rem); margin-bottom: 1.6rem; }
.entry--front { padding: 0; background: transparent; border: 0; box-shadow: none; }
.entry--front::after { display: none; }
.entry-header { margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 2px dashed var(--line); }
.page-title,
.entry-title { margin: 0; font-size: clamp(1.9rem, 5vw, 3.15rem); line-height: 1.25; letter-spacing: .015em; }
.entry-title a { color: var(--ink); }
.entry-meta { color: var(--muted); font-size: .9rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2 {
  margin: 2.5rem 0 1rem;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  line-height: 1.35;
}
.entry-content h3 { margin: 1.9rem 0 .7rem; font-size: 1.22rem; line-height: 1.45; }
.entry-content p { margin: 0 0 1.1rem; }
.entry-content ul,
.entry-content ol { padding-left: 1.45rem; }
.entry-content li + li { margin-top: .35rem; }
.entry-content hr { border: 0; border-top: 2px dashed var(--line); margin: 2rem 0; }

/* Miengena physical component library used in fixed-page HTML */
.mg-hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.5rem;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 22px;
  box-shadow: var(--shadow-paper);
}
.mg-hero::before {
  content: "MIENGENA / WEB STUDIO";
  position: absolute;
  top: 1rem;
  right: -2.4rem;
  transform: rotate(7deg);
  padding: .35rem 2.7rem;
  color: rgba(21,75,88,.72);
  border: 2px solid rgba(21,75,88,.35);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .12em;
  background: rgba(220,237,239,.65);
}
.mg-kicker {
  display: inline-block;
  margin: 0 0 .8rem;
  padding: .32rem .7rem;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: var(--warm-soft);
  color: #71402b;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 rgba(112,77,51,.16);
}
.mg-hero h1 { max-width: 13em; margin: 0 0 1rem; font-size: clamp(2.2rem, 8vw, 4.4rem); line-height: 1.12; letter-spacing: -.02em; }
.mg-hero__lead { max-width: 46rem; margin: 0; font-size: clamp(1.05rem, 2.5vw, 1.3rem); font-weight: 700; }
.mg-hero__text { max-width: 48rem; color: var(--muted); }
.mg-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.35rem; }
.mg-button,
.miengena-button,
.wp-block-button__link,
.read-more {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem 1rem;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent-deep);
  border-bottom: 4px solid var(--accent-deep);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 900;
  line-height: 1.25;
  box-shadow: 0 3px 8px rgba(21,75,88,.17);
}
.mg-button:hover,
.miengena-button:hover,
.wp-block-button__link:hover,
.read-more:hover { color: #fff; transform: translateY(-1px); }
.mg-button:active,
.miengena-button:active { transform: translateY(2px); border-bottom-width: 2px; }
.mg-button--secondary { color: var(--ink); background: var(--paper-2); border-color: var(--line-dark); }
.mg-button--secondary:hover { color: var(--ink); background: #fff; }

.mg-section {
  position: relative;
  margin: 1.5rem 0;
  padding: clamp(1.2rem, 3.5vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-paper);
}
.mg-section--soft { background: var(--paper-2); }
.mg-section--accent { background: var(--accent-soft); border-color: #93b9c0; }
.mg-section--warm { background: #fff8f2; border-color: #ddb39e; }
.mg-section__label {
  display: inline-block;
  margin: -2.1rem 0 1rem .25rem;
  padding: .4rem .9rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 3px 0 var(--accent-deep);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.mg-section h2:first-of-type { margin-top: 0; }

.mg-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 1rem; }
.mg-grid > * { grid-column: span 12; }
.mg-card {
  position: relative;
  padding: 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.mg-card::before {
  content: "";
  position: absolute;
  top: .5rem;
  left: 50%;
  width: 44px;
  height: 9px;
  transform: translateX(-50%);
  border: 1px solid rgba(136,124,104,.5);
  border-radius: 999px;
  background: rgba(216,208,192,.55);
}
.mg-card h3 { margin-top: .7rem; }
.mg-card__eyebrow { margin: .6rem 0 .3rem; color: var(--warm); font-size: .76rem; font-weight: 900; letter-spacing: .1em; }
.mg-card__link { margin: 1rem 0 0; font-weight: 800; }
.mg-card__link a::after { content: " →"; }

.mg-index-grid { display: grid; gap: .8rem; margin: 1.1rem 0; }
.mg-index {
  display: block;
  position: relative;
  padding: 1rem 1rem 1rem 4.3rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  text-decoration: none;
  box-shadow: var(--shadow-press);
}
.mg-index::before {
  content: attr(data-code);
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  place-items: center;
  width: 3.4rem;
  color: #fff;
  background: var(--accent);
  border-radius: 11px 0 0 11px;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .07em;
}
.mg-index strong { display: block; font-size: 1.05rem; }
.mg-index small { display: block; color: var(--muted); margin-top: .15rem; }
.mg-index:hover { transform: translateY(-1px); background: #fff; }

.mg-note {
  margin: 1.4rem 0;
  padding: 1.1rem 1.15rem 1.1rem 1.35rem;
  background: #fff9d9;
  border: 1px solid #d5c06a;
  border-left: 6px solid #b69b31;
  border-radius: 8px 14px 14px 8px;
  box-shadow: 2px 5px 14px rgba(93,72,25,.10);
}
.mg-note > *:last-child { margin-bottom: 0; }

.mg-quote {
  margin: 1.3rem 0;
  padding: 1.2rem 1.35rem;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 2px solid #9ec0c5;
  border-radius: 13px;
  font-size: 1.08rem;
  font-weight: 800;
}

.mg-check-list { list-style: none; margin: 1rem 0; padding: 0; }
.mg-check-list li { position: relative; padding: .62rem .7rem .62rem 2.2rem; border-bottom: 1px dashed var(--line); }
.mg-check-list li::before { content: "✓"; position: absolute; left: .55rem; top: .6rem; color: var(--success); font-weight: 1000; }

.mg-step-list { counter-reset: mgstep; display: grid; gap: .8rem; margin: 1.2rem 0; }
.mg-step {
  counter-increment: mgstep;
  position: relative;
  padding: 1.1rem 1.1rem 1.1rem 4.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-press);
}
.mg-step::before {
  content: counter(mgstep, decimal-leading-zero);
  position: absolute;
  left: .8rem;
  top: .9rem;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  color: #fff;
  background: var(--warm);
  border: 1px solid #8f4e31;
  border-bottom-width: 4px;
  border-radius: 10px;
  font-weight: 900;
}
.mg-step h3 { margin: 0 0 .35rem; }
.mg-step p:last-child { margin-bottom: 0; }

.mg-price-grid { display: grid; gap: 1rem; }
.mg-price-card {
  padding: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.mg-price-card__type { margin: 0; color: var(--accent-deep); font-weight: 900; }
.mg-price-card__price { margin: .3rem 0 .8rem; font-size: clamp(1.45rem, 5vw, 2rem); line-height: 1.25; font-weight: 1000; }
.mg-price-card__meta { color: var(--muted); font-size: .92rem; }
.mg-price-card ul { margin-bottom: 0; }

.mg-project {
  position: relative;
  padding: 1.3rem;
  background: var(--paper);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.mg-project + .mg-project { margin-top: 1rem; }
.mg-project__tag { display: inline-block; padding: .25rem .55rem; color: #fff; background: var(--warm); border-radius: 5px; font-size: .75rem; font-weight: 900; }
.mg-project h2,
.mg-project h3 { margin-top: .8rem; }
.mg-project dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .8rem; }
.mg-project dt { font-weight: 900; }
.mg-project dd { margin: 0; }

.mg-faq { margin: 1rem 0; }
.mg-faq details { margin: .7rem 0; padding: .9rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-press); }
.mg-faq summary { cursor: pointer; font-weight: 900; }
.mg-faq details[open] summary { margin-bottom: .8rem; }

.mg-cta {
  margin: 1.6rem 0 .2rem;
  padding: clamp(1.3rem, 4vw, 2.2rem);
  background: var(--ink);
  color: #fff;
  border: 1px solid #000;
  border-radius: 18px;
  box-shadow: 0 5px 0 #0b1114, 0 14px 26px rgba(25,30,32,.20);
}
.mg-cta h2,
.mg-cta h3 { color: #fff; margin-top: 0; }
.mg-cta a:not(.mg-button) { color: #fff; }
.mg-cta .mg-button { background: #fff; color: var(--ink); border-color: #c7c7c7; }

.mg-mini-nav { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0; }
.mg-mini-nav a { display: inline-flex; padding: .45rem .7rem; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 800; }

/* Forms */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: .72rem .8rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line-dark);
  border-radius: 10px;
  box-shadow: inset 0 1px 4px rgba(84,68,45,.08);
}
textarea { min-height: 180px; resize: vertical; }
input[type="submit"], button[type="submit"] {
  min-height: 50px;
  padding: .7rem 1.1rem;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent-deep);
  border-bottom: 4px solid var(--accent-deep);
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}
.wpcf7 form > p { margin-bottom: 1rem; }
.wpcf7 label { font-weight: 800; }

/* Blog/archive */
.grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 1.2rem; }
.grid > * { grid-column: span 12; }
.sidebar-area { display: grid; gap: 1rem; }
.widget { padding: 1rem; }
.navigation.pagination,
.post-navigation { margin: 1.4rem 0; padding: 1rem; background: rgba(255,253,246,.82); border: 1px solid var(--line); border-radius: 12px; }
.nav-links { display: flex; gap: .7rem; justify-content: space-between; flex-wrap: wrap; }

/* Footer */
.site-footer {
  padding: 2.2rem 0 2.6rem;
  color: #eaf0f2;
  background: #243137;
  border-top: 5px solid var(--warm);
}
.footer-inner { display: grid; gap: 1rem; }
.footer-brand__name { margin: 0; font-size: 1.25rem; font-weight: 1000; }
.footer-brand__copy { margin: .2rem 0 0; color: #cbd5d9; }
.footer-nav ul,
.custom-footer-menu ul { display: flex; flex-wrap: wrap; gap: .4rem .9rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: #fff; }
.footer-business-info p,
.copyright { margin: .25rem 0; color: #d8e0e3; font-size: .9rem; }

/* Fixed LINE action */
body.has-miengena-line-fixed { padding-bottom: 0; }
.miengena-line-fixed { position: fixed; right: 18px; bottom: 18px; z-index: 70; }
.miengena-line-fixed__label { display: block; margin: 0 0 .25rem auto; width: max-content; padding: .18rem .45rem; color: #31583d; background: #f5fff7; border: 1px solid #83b992; border-radius: 6px; font-size: .7rem; font-weight: 800; box-shadow: var(--shadow-press); }
.miengena-line-fixed__link { display: flex; align-items: center; gap: .65rem; min-height: 58px; padding: .55rem .8rem; color: #143d22; background: #ecfff0; border: 1px solid #4c9961; border-bottom: 4px solid #327747; border-radius: 14px; text-decoration: none; box-shadow: 0 8px 22px rgba(28,93,47,.2); }
.miengena-line-fixed__mark { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .35rem; color: #fff; background: #278a44; border-radius: 9px; font-size: .7rem; font-weight: 1000; }
.miengena-line-fixed__text { display: grid; }
.miengena-line-fixed__main { font-weight: 1000; }
.miengena-line-fixed__sub { font-size: .73rem; }

/* Mobile app navigation */
.mobile-app-nav { display: none; }

/* Accessibility modes */
body.font-large { font-size: 21px; }
body.high-contrast {
  --desk: #000;
  --desk-deep: #000;
  --paper: #000;
  --paper-2: #111;
  --paper-3: #111;
  --ink: #fff;
  --muted: #efefef;
  --line: #fff;
  --line-dark: #fff;
  --accent: #00e5ff;
  --accent-deep: #00e5ff;
  --accent-soft: #111;
  --warm: #ffe000;
  --warm-soft: #111;
  --success: #7cff98;
}
body.high-contrast::before { display: none; }
body.high-contrast .site-header,
body.high-contrast .mg-section,
body.high-contrast .mg-card,
body.high-contrast .mg-price-card,
body.high-contrast .mg-project,
body.high-contrast .mg-step,
body.high-contrast .mg-index,
body.high-contrast .entry,
body.high-contrast .breadcrumbs { background: #000; color: #fff; }
body.high-contrast .mg-hero { background: #000; color: #fff; }
body.high-contrast .mg-button--secondary { color: #fff; background: #111; }
body.high-contrast input,
body.high-contrast textarea,
body.high-contrast select { color: #fff; background: #000; border-color: #fff; }
body.high-contrast .site-footer { border-top-color: #fff; }

@media (min-width: 720px) {
  .mg-grid--2 > * { grid-column: span 6; }
  .mg-grid--3 > * { grid-column: span 4; }
  .mg-price-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mg-index-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid--sidebar .content-area { grid-column: span 8; }
  .grid--sidebar .sidebar-area { grid-column: span 4; }
}

@media (min-width: 960px) {
  .mg-price-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .mg-index-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 767px) {
  :root { --mobile-nav-h: 74px; }
  body { font-size: 17px; background: var(--paper-3); padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)); }
  .wrap { width: min(calc(100% - 20px), var(--max)); }
  .site-header { top: 0; }
  .header-inner { min-height: 64px; padding-block: .45rem; }
  .site-logo img { max-height: 38px; }
  .site-title { font-size: 1.18rem; }
  .site-description { display: none; }
  .header-actions { gap: .3rem; }
  .tool-button { min-height: 42px; padding: .45rem .62rem; border-radius: 10px; font-size: .78rem; }
  .font-size-toggle,
  .contrast-toggle { max-width: 5.6rem; }
  .nav-shell { border-top: 0; }
  .primary-nav {
    display: none;
    position: absolute;
    top: calc(100% - 1px);
    left: 10px;
    right: 10px;
    padding: .85rem;
    background: var(--paper);
    border: 1px solid var(--line-dark);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 14px 30px rgba(48,38,24,.24);
  }
  body.menu-open .primary-nav { display: block; }
  .primary-nav ul { display: grid; gap: .45rem; }
  .primary-nav a { width: 100%; min-height: 48px; padding: .65rem .8rem; border-radius: 10px; }

  .site-main { padding: 1rem 0 2rem; }
  .breadcrumbs { margin-bottom: .7rem; padding: .55rem .7rem; font-size: .8rem; }
  .entry { padding: 1rem; border-radius: 14px; }
  .entry--front { padding: 0; }
  .mg-hero { margin: 0 0 .85rem; padding: 1.35rem 1.05rem 1.25rem; border-radius: 16px; }
  .mg-hero::before { top: .65rem; right: -3.1rem; font-size: .58rem; }
  .mg-hero h1 { max-width: 9.5em; font-size: clamp(2.15rem, 12vw, 3.6rem); }
  .mg-hero__lead { font-size: 1.05rem; }
  .mg-actions { display: grid; grid-template-columns: 1fr; }
  .mg-button { width: 100%; }
  .mg-section { margin: .9rem 0; padding: 1rem; border-radius: 14px; }
  .mg-section__label { margin: -1.75rem 0 .8rem .15rem; }
  .mg-card,
  .mg-project,
  .mg-price-card { padding: 1rem; }
  .mg-project dl { grid-template-columns: 1fr; gap: .15rem; }
  .mg-project dd + dt { margin-top: .45rem; }
  .mg-step { padding: 4.3rem 1rem 1rem; }
  .mg-step::before { left: 1rem; top: .9rem; }
  .mg-index { padding-left: 3.8rem; }

  .site-footer { padding-bottom: calc(1.8rem + env(safe-area-inset-bottom)); }
  .mobile-app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    min-height: var(--mobile-nav-h);
    padding: .35rem max(.25rem, env(safe-area-inset-right)) calc(.3rem + env(safe-area-inset-bottom)) max(.25rem, env(safe-area-inset-left));
    background: rgba(255,253,246,.98);
    border-top: 1px solid var(--line-dark);
    box-shadow: 0 -8px 22px rgba(60,48,29,.18);
    backdrop-filter: blur(10px);
  }
  .mobile-app-nav a {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1rem;
    padding: .2rem .1rem;
    color: var(--ink);
    border-radius: 10px;
    text-decoration: none;
    font-size: .66rem;
    font-weight: 900;
    line-height: 1.15;
  }
  .mobile-app-nav a[aria-current="page"] { color: var(--accent-deep); background: var(--accent-soft); }
  .mobile-app-nav__icon { display: grid; place-items: center; min-height: 28px; font-size: 1.1rem; font-weight: 1000; }
  .mobile-app-nav__contact { color: #fff !important; background: var(--accent) !important; border: 1px solid var(--accent-deep); box-shadow: 0 2px 0 var(--accent-deep); }
  .miengena-line-fixed { right: 10px; bottom: calc(var(--mobile-nav-h) + 9px + env(safe-area-inset-bottom)); }
  .miengena-line-fixed__label,
  .miengena-line-fixed__sub { display: none; }
  .miengena-line-fixed__link { min-height: 48px; padding: .35rem .55rem; border-radius: 12px; }
  .miengena-line-fixed__mark { min-width: 34px; height: 34px; font-size: .62rem; }
  .miengena-line-fixed__main { font-size: .78rem; }
}

@media (max-width: 390px) {
  .font-size-toggle,
  .contrast-toggle { display: none; }
  .site-title { font-size: 1.08rem; }
  .tool-button--menu { font-size: .74rem; }
  .mobile-app-nav a { font-size: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  body { background: #fff; color: #000; padding: 0; }
  body::before,
  .site-header,
  .site-footer,
  .mobile-app-nav,
  .miengena-line-fixed,
  .breadcrumbs { display: none !important; }
  .site-main { padding: 0; }
  .wrap { width: 100%; }
  .entry,
  .mg-hero,
  .mg-section,
  .mg-card,
  .mg-price-card,
  .mg-project { box-shadow: none; border-color: #777; break-inside: avoid; }
}
