/* =========================================================
   上高田整骨院 — 陰陽 × 竹
   Taken from the clinic's panda yin-yang mark: ink black and
   paper white in balance, with bamboo green as the only accent.
   ========================================================= */

:root {
  /* Palette */
  --ai: #1c1c1c;          /* 墨 ink black — primary (name kept for subpages) */
  --kon: #121212;         /* 漆黒 — bands, footer */
  --kinari: #f4f4f1;      /* 胡粉 paper white — page */
  --shiro: #ffffff;       /* 白 surfaces */
  --sumi: #1c1c1c;        /* 墨 text */
  --nezumi: #63655f;      /* 鼠 muted text */
  --kincha: #4f7f3a;      /* 竹 bamboo — the only accent */
  --kincha-light: #9cc47f;/* 若竹 young bamboo, for dark grounds */
  --line-green: #06c755;
  --rule: #d6d8dc;

  /* Type */
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;

  /* Legacy names used by reserve.html / manage.html */
  --green: var(--ai);
  --green-dark: var(--kon);
  --accent: var(--kincha);
  --line: var(--line-green);
  --ink: var(--sumi);
  --muted: var(--nezumi);
  --soft: #e9ebe6;
  --paper: var(--shiro);
  --edge: var(--rule);
  --shadow: 0 18px 40px rgba(0, 0, 0, .12);

  --header-h: 72px;
  --bamboo-line: repeating-linear-gradient(90deg, var(--kincha) 0 26px, #2f5222 26px 29px);
  --bamboo-line-light: repeating-linear-gradient(90deg, var(--kincha-light) 0 26px, #5e8a45 26px 29px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  color: var(--sumi);
  background: var(--kinari);
  font-feature-settings: "palt" 0;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.45; margin: 0; letter-spacing: .02em; }
h1, h2, .about-lead { word-break: auto-phrase; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--kincha); outline-offset: 3px; }

.container { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--ai); color: #fff; border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* ---------- Stitch: the one decorative device ---------- */
.stitch {
  display: block;
  height: 3px; border-radius: 2px;
  background: var(--bamboo-line-light);
}
.stitch-hero {
  width: min(220px, 60%);
  margin: 26px 0 26px;
  background-size: 100% 2px;
  background-repeat: no-repeat;
  animation: sew 1.4s cubic-bezier(.6, 0, .3, 1) .35s both;
  clip-path: inset(-12px 100% -12px 0);
  position: relative;
}
.stitch-hero::after {   /* the same bamboo leaf as on the section titles, at the tip */
  content: ""; position: absolute; left: calc(100% - 4px); bottom: -3px;
  width: 22px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 10'%3E%3Cpath d='M0 7C6 1 14 0 22 2C15 5 8 8 0 7Z' fill='%239cc47f'/%3E%3C/svg%3E") no-repeat center / contain;
}
@keyframes sew { to { clip-path: inset(-12px -30px -12px 0); } }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 30;
  background: rgba(244, 244, 241, .92);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.topbar {
  width: min(1200px, calc(100% - 40px));
  height: var(--header-h);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.logo-name { font-family: var(--serif); font-weight: 800; font-size: 21px; letter-spacing: .08em; color: var(--sumi); }
.site-nav { display: flex; align-items: center; gap: 26px; font-size: 14px; font-weight: 500; }
.site-nav a { position: relative; padding: 6px 0; color: var(--sumi); }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: repeating-linear-gradient(90deg, var(--kincha) 0 5px, transparent 5px 8px);
  opacity: 0; transition: opacity .2s ease;
}
.site-nav a:hover::after, .site-nav a.active::after { opacity: 1; }
.language-selector {
  height: 36px; padding: 0 30px 0 12px;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--shiro) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231c1c1c' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
  appearance: none; font-size: 13px; cursor: pointer;
}
.menu-toggle {
  display: none; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--shiro); cursor: pointer;
}
.menu-toggle span { display: block; width: 18px; height: 1.5px; margin: 4px auto; background: var(--ai); transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: min(860px, 100svh);
  padding-top: var(--header-h);
}
.hero-panel {
  --panel: var(--ai);
  position: relative; z-index: 2;
  display: flex; align-items: center;
  background: var(--panel);
  color: #fff;
  isolation: isolate;
}
.hero-panel::before {   /* bamboo grove, very faint */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("images/bamboo.svg") right -40px bottom / auto 110% no-repeat;
  opacity: .2;
}
.hero-panel::after {    /* the yin-yang S between ink and photo */
  content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 110px;
  background: var(--panel);
  -webkit-mask: url("images/wave-v.svg") 0 0 / 100% 100% no-repeat;
          mask: url("images/wave-v.svg") 0 0 / 100% 100% no-repeat;
}
.hero-content { width: 100%; max-width: 560px; margin-left: auto; padding: 72px 56px 88px 40px; }
.hero-eyebrow { font-size: 14px; letter-spacing: .12em; color: var(--kincha-light); font-weight: 700; }
.hero h1 { margin-top: 18px; font-size: clamp(32px, 3.6vw, 50px); font-weight: 800; line-height: 1.4; letter-spacing: .04em; }
.hero-copy { max-width: 30em; color: rgba(255,255,255,.86); font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-subactions { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; }
.hero-info {
  display: flex; flex-wrap: wrap; gap: 6px 28px;
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: 14px; color: rgba(255,255,255,.82);
}
.hero-photo { margin: 0; position: relative; overflow: hidden; background: var(--kon); }
.hero-bg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.pause-notice {
  margin-bottom: 24px; padding: 12px 16px;
  border-left: 3px solid var(--kincha-light);
  background: rgba(255,255,255,.1);
  font-weight: 700; line-height: 1.6;
}
.pause-notice[hidden] { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 28px;
  border-radius: 6px; font-weight: 700; font-size: 15px; letter-spacing: .04em;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-reserve { background: #fff; color: #1c1c1c; }
.btn-reserve:hover { background: var(--kincha-light); }
.btn-phone { border: 1px solid rgba(255,255,255,.5); color: #fff; }
.btn-phone:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-sub {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 14px; font-weight: 700;
  border-bottom: 1px solid currentColor;
}
.btn-sub.btn-line::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-green);
}
.hero .btn-sub { color: rgba(255,255,255,.9); border-color: rgba(255,255,255,.35); }
.hero .btn-sub:hover { color: #fff; border-color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 120px 0; scroll-margin-top: var(--header-h); }
.section-title {
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 700;
  color: var(--ai);
  padding-bottom: 22px;
  margin-bottom: 48px;
  position: relative;
}
.section-title::before {   /* a single bamboo leaf at the tip of the line */
  content: ""; position: absolute; left: 80px; bottom: -3px;
  width: 22px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 10'%3E%3Cpath d='M0 7C6 1 14 0 22 2C15 5 8 8 0 7Z' fill='%234f7f3a'/%3E%3C/svg%3E") no-repeat center / contain;
}
.contact .section-title::before, body.night-mode .section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 10'%3E%3Cpath d='M0 7C6 1 14 0 22 2C15 5 8 8 0 7Z' fill='%239cc47f'/%3E%3C/svg%3E");
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 84px; height: 3px; border-radius: 2px;
  background: var(--bamboo-line);
}

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 80px; align-items: center; }
.about-text p { max-width: 34em; color: var(--nezumi); }
.about-text p + p { margin-top: 1em; }
.about-text .about-lead { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--sumi); margin-bottom: 20px; }
.about-photo { margin: 0; position: relative; }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.about-photo::before {
  content: ""; position: absolute; inset: 18px -18px -18px 18px; z-index: -1;
  background: var(--sumi); border-radius: 4px;
}
.about-photo { isolation: isolate; }

/* Features */
.features { background: var(--shiro); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.feature { padding: 4px 40px 8px; border-left: 1px dashed var(--rule); }
.feature:first-child { padding-left: 0; border-left: 0; }
.feature:last-child { padding-right: 0; }
.seal {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin-bottom: 26px;
  background: var(--ai); color: #fff;
  font-family: var(--serif); font-weight: 800; font-size: 28px; line-height: 1;
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px var(--ai), inset 0 0 0 4px rgba(255,255,255,.3);
}
.feature h3 { font-size: 20px; color: var(--sumi); margin-bottom: 12px; }
.feature p { color: var(--nezumi); font-size: 15px; }

/* Service — set like a menu */
.service-list { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 64px; border-top: 1px solid var(--rule); }
.service-item { display: grid; grid-template-columns: 11em 1fr; gap: 20px; padding: 30px 0; border-bottom: 1px dashed var(--rule); }
.service-item dt { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--ai); line-height: 1.5; }
.service-item dd { margin: 0; color: var(--nezumi); font-size: 15px; }

/* Flow — a real sequence, so it is numbered */
.flow { background: var(--shiro); }
.flow-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; position: relative; }
.flow-list::before {
  content: ""; position: absolute; left: 28px; right: calc((100% - 112px) / 5 - 28px); top: 27px; height: 3px;
  background: var(--bamboo-line); border-radius: 2px;
}
.flow-list li { position: relative; }
.flow-num {
  position: relative; display: grid; place-items: center;
  width: 56px; height: 56px; margin-bottom: 22px;
  border-radius: 50%; background: var(--shiro); border: 1.5px solid var(--ai);
  font-family: var(--serif); font-weight: 800; font-size: 22px; color: var(--ai);
}
.flow-list h3 { font-size: 18px; margin-bottom: 8px; }
.flow-list p { color: var(--nezumi); font-size: 14px; line-height: 1.8; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 16px; }
.gallery-grid img { width: 100%; height: 420px; object-fit: cover; border-radius: 4px; cursor: zoom-in; }

/* FAQ */
.faq { background: var(--shiro); }
.faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.faq-list { border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-question {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 26px 0; border: 0; background: none; cursor: pointer; text-align: left;
  font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--sumi);
}
.faq-question::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background: linear-gradient(var(--ai), var(--ai)) center / 14px 1.5px no-repeat,
              linear-gradient(var(--ai), var(--ai)) center / 1.5px 14px no-repeat;
  transition: transform .25s ease;
}
.faq-item.open .faq-question::after { transform: rotate(45deg); }
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.faq-answer > p { overflow: hidden; color: var(--nezumi); }
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-item.open .faq-answer > p { padding-bottom: 26px; }

/* Contact */
.contact {
  color: #fff;
  background: var(--ai);
  position: relative; isolation: isolate; overflow: hidden;
}
.contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("images/bamboo.svg") left -60px bottom / auto 120% no-repeat;
  opacity: .14; transform: scaleX(-1);
}
.contact .section-title { color: #fff; }
.contact .section-title::before {   /* a single bamboo leaf at the tip of the line */
  content: ""; position: absolute; left: 80px; bottom: -3px;
  width: 22px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 10'%3E%3Cpath d='M0 7C6 1 14 0 22 2C15 5 8 8 0 7Z' fill='%234f7f3a'/%3E%3C/svg%3E") no-repeat center / contain;
}
.contact .section-title::before, body.night-mode .section-title::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 10'%3E%3Cpath d='M0 7C6 1 14 0 22 2C15 5 8 8 0 7Z' fill='%239cc47f'/%3E%3C/svg%3E");
}
.section-title::after { background: var(--bamboo-line-light); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: start; }
.contact-list { margin: 0; }
.contact-list > div { display: grid; grid-template-columns: 7em 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.contact-list dt { color: var(--kincha-light); font-size: 14px; font-weight: 500; padding-top: 2px; }
.contact-list dd { margin: 0; color: rgba(255,255,255,.9); }
.contact-phone { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: .04em; line-height: 1.2; color: #fff; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 36px; }
.contact .btn-sub { color: #fff; border-color: rgba(255,255,255,.4); }
.map-area iframe { display: block; width: 100%; height: 380px; border: 0; border-radius: 4px; background: rgba(255,255,255,.06); filter: grayscale(1) contrast(1.05); }
.map-link { display: inline-block; margin-top: 14px; font-size: 14px; color: rgba(255,255,255,.85); border-bottom: 1px solid rgba(255,255,255,.35); }

/* Footer */
.site-footer { background: var(--kon); color: rgba(255,255,255,.7); padding: 44px 0 120px; font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.site-footer strong { display: block; margin-bottom: 8px; font-family: var(--serif); font-size: 17px; color: #fff; letter-spacing: .08em; }
.footer-meta { display: grid; justify-items: end; gap: 6px; }
.footer-meta a { border-bottom: 1px solid rgba(255,255,255,.3); }

/* Back to top */
.back-top {   /* a 太極 disc that turns with the page; the "︿" above it stays still */
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: none; align-items: center; justify-content: center;
  width: 50px; height: 50px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer;
  transition: transform .25s cubic-bezier(.3, 1.5, .5, 1);
}
.back-top-taiji {
  position: absolute; inset: 0; border-radius: 50%;
  background: url("images/taiji.svg") center / 100% 100% no-repeat;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  transform: rotate(var(--rot, 0deg)); will-change: transform;
}
.back-top span {   /* the "up" chevron, sitting just above the disc */
  display: block; position: absolute; left: 50%; top: -15px; width: 9px; height: 9px;
  border-left: 2.5px solid var(--sumi); border-top: 2.5px solid var(--sumi); border-radius: 1px 0 0 0;
  transform: translateX(-50%) rotate(45deg); transition: transform .2s ease;
}
.back-top:hover { transform: translateY(-3px); }
.back-top:hover span { transform: translateX(-50%) translateY(-2px) rotate(45deg); }
.back-top:focus-visible { outline: 2px solid var(--kincha); outline-offset: 3px; }

/* ---------- Floating reservation calendar ---------- */
#fixedCalendarRoot .fixed-calendar {
  position: fixed; right: 20px; bottom: 20px; z-index: 35;
  width: 344px; padding: 16px 16px 12px;
  background: var(--shiro); color: var(--sumi);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2), 0 0 0 1px rgba(0, 0, 0, .06);
}
#fixedCalendarRoot button.fixed-calendar-title {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding: 0; border: 0; background: none; cursor: default; text-align: left;
}
#calendarTitle { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--ai); }
.fixed-calendar-meta { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--nezumi); }
.fixed-calendar-chevron { display: none; }
#fixedCalendarRoot .fixed-calendar::before {
  content: ""; position: absolute; left: 26px; top: -42px;
  width: 76px; height: 44px; pointer-events: none;
  background: url("images/panda-peek.svg") center bottom / contain no-repeat;
  animation: panda-peek .7s cubic-bezier(.3, 1.5, .5, 1) 1.1s backwards;
  transition: transform .25s ease;
}
#fixedCalendarRoot .fixed-calendar:hover::before { transform: translateY(-4px); }
@keyframes panda-peek { from { transform: translateY(26px); opacity: 0; } }
.fixed-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.fixed-calendar-day {
  display: grid; justify-items: center; align-content: center; gap: 1px;
  min-height: 50px; padding: 4px 0;
  border: 1px solid var(--rule); border-radius: 6px;
  line-height: 1.15; transition: border-color .15s ease, background-color .15s ease;
}
a.fixed-calendar-day:hover { border-color: var(--kincha); background: #f3f7ef; }
.fixed-calendar-weekday { font-size: 10px; color: var(--nezumi); }
.fixed-calendar-day strong { font-size: 16px; font-weight: 700; color: var(--sumi); }
.fixed-calendar-day small { font-size: 9px; color: var(--nezumi); }
.fixed-calendar-day.today { background: var(--ai); border-color: var(--ai); }
.fixed-calendar-day.today strong, .fixed-calendar-day.today .fixed-calendar-weekday, .fixed-calendar-day.today small { color: #fff; }
.fixed-calendar-day.closed { background: var(--kinari); border-color: transparent; }
.fixed-calendar-day.closed strong { color: #a5a7a2; }
.fixed-calendar-legend { display: flex; justify-content: flex-end; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--nezumi); }

/* ---------- Night (after 19:00 Tokyo time): the yin side ---------- */
body.night-mode {
  --kinari: #141414;
  --shiro: #1d1d1c;
  --sumi: #ecebe6;
  --nezumi: #a6a8a2;
  --rule: #33342f;
  --soft: #262725;
  --paper: #1d1d1c;
  --edge: #33342f;
}
body.night-mode .site-header { background: rgba(20, 20, 20, .9); border-bottom-color: rgba(255,255,255,.06); }
body.night-mode .logo-mark { background: #fff; box-shadow: 0 0 0 2px #fff; }
body.night-mode .seal { background: #fff; color: #141414; box-shadow: none; }
body.night-mode .hero-panel { --panel: #0b0b0b; }
body.night-mode .about-photo::before { background: var(--kincha-light); opacity: .25; }
body.night-mode .flow-num { border-color: var(--kincha-light); color: var(--sumi); }
body.night-mode .section-title { color: var(--sumi); }
body.night-mode .service-item dt { color: var(--sumi); }
body.night-mode .faq-question::after { background: linear-gradient(var(--sumi), var(--sumi)) center / 14px 1.5px no-repeat, linear-gradient(var(--sumi), var(--sumi)) center / 1.5px 14px no-repeat; }
body.night-mode .contact { background: #0b0b0b; }
body.night-mode .site-footer { background: #060606; }
body.night-mode .back-top-taiji { background-image: url("images/taiji-night.svg"); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
body.night-mode .back-top span { border-color: #88aa6f; }
body.night-mode .language-selector { background-color: var(--shiro); border-color: var(--rule); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ecebe6' stroke-width='1.5'/%3E%3C/svg%3E"); }
body.night-mode .menu-toggle { background: var(--shiro); border-color: var(--rule); }
body.night-mode .menu-toggle span { background: var(--sumi); }
body.night-mode #calendarTitle { color: var(--sumi); }
body.night-mode .fixed-calendar-day.today { background: var(--kincha-light); border-color: var(--kincha-light); }
body.night-mode .fixed-calendar-day.today strong,
body.night-mode .fixed-calendar-day.today .fixed-calendar-weekday,
body.night-mode .fixed-calendar-day.today small { color: #10140d; }
body.night-mode a.fixed-calendar-day:hover { background: #22281d; border-color: var(--kincha-light); }
body.night-mode .fixed-calendar-day.closed strong { color: #5c5e58; }
body.night-mode #fixedCalendarRoot .fixed-calendar { box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .site-nav { gap: 18px; }
  .flow-list { grid-template-columns: repeat(3, 1fr); row-gap: 48px; }
  .flow-list::before { display: none; }
}

@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 24px 20px; background: var(--kinari);
    border-bottom: 1px solid var(--rule); box-shadow: 0 18px 30px rgba(0,0,0,.08);
    font-size: 16px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .site-nav a::after { display: none; }
  .language-selector { margin-top: 16px; height: 44px; }

  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-content { max-width: none; margin: 0; padding: 48px 24px 52px; }
  .hero-photo { height: 260px; order: 2; }
  .hero-panel::after {
    top: 100%; bottom: auto; left: 0; right: 0; width: auto; height: 44px;
    -webkit-mask-image: url("images/wave-h.svg"); mask-image: url("images/wave-h.svg");
  }
  .hero-panel::before { background-position: right -80px bottom; background-size: auto 100%; }
  .about-grid, .contact-grid, .faq-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-photo { max-width: 460px; margin-right: 12px; }
  .about-photo::before { inset: 12px -12px -12px 12px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature { padding: 32px 0; border-left: 0; border-top: 1px dashed var(--rule); display: grid; grid-template-columns: 56px 1fr; column-gap: 22px; }
  .feature:first-child { border-top: 0; padding-top: 0; }
  .feature .seal { grid-row: span 2; margin: 0; }
  .feature h3 { margin-bottom: 6px; }
  .service-list { grid-template-columns: 1fr; }
  .faq-grid .section-title { margin-bottom: 8px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { width: calc(100% - 40px); }
  .logo-name { font-size: 18px; }
  .logo-mark { width: 38px; height: 38px; }
  .section { padding: 80px 0; }
  .section-title { margin-bottom: 36px; }
  .hero h1 { font-size: 30px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-info { flex-direction: column; margin-top: 30px; }
  .service-item { grid-template-columns: 1fr; gap: 4px; padding: 22px 0; }
  .flow-list { grid-template-columns: 1fr; row-gap: 0; }
  .flow-list li { display: grid; grid-template-columns: 48px 1fr; column-gap: 18px; padding-bottom: 28px; }
  .flow-list li:not(:last-child)::before {
    content: ""; position: absolute; left: 23px; top: 52px; bottom: 4px; width: 2px;
    background: repeating-linear-gradient(180deg, var(--kincha) 0 26px, #2f5222 26px 29px); width: 3px; border-radius: 2px;
  }
  .flow-num { width: 48px; height: 48px; font-size: 19px; margin: 0; grid-row: span 2; }
  .flow-list h3 { padding-top: 10px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid img { height: 200px; }
  .gallery-grid img:first-child { grid-column: 1 / -1; height: 240px; }
  .contact-phone { font-size: 26px; }
  .contact-list > div { grid-template-columns: 1fr; gap: 2px; }
  .map-area iframe { height: 280px; }
  .footer-inner { flex-direction: column; align-items: start; }
  .footer-meta { justify-items: start; }

  /* Calendar becomes a slim bar on phones; tap to open */
  #fixedCalendarRoot .fixed-calendar { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; padding: 12px 14px 10px; }
  #fixedCalendarRoot button.fixed-calendar-title { cursor: pointer; min-height: 28px; }
  .fixed-calendar-chevron {
    display: inline-block; width: 8px; height: 8px; margin: 0 2px 3px 2px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  }
  #fixedCalendarRoot .fixed-calendar.collapsed { padding: 10px 14px; }
  #fixedCalendarRoot .fixed-calendar.collapsed button.fixed-calendar-title { margin-bottom: 0; }
  .fixed-calendar.collapsed .fixed-calendar-chevron { transform: rotate(-135deg); margin-bottom: -3px; }
  .fixed-calendar.collapsed #calendarBody { display: none; }
  .fixed-calendar-day { min-height: 44px; }
  .back-top { right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stitch-hero { animation: none; clip-path: none; }
  #fixedCalendarRoot .fixed-calendar::before { animation: none; }
  .faq-answer, .faq-question::after { transition: none; }
}
.footer-mark { width: 48px; height: 48px; margin-bottom: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #fff; }

/* =========================================================
   Motion
   - page-to-page: cross-document view transition (fade)
   - homepage: one load sequence in the hero, then blocks
     reveal once as they scroll into view
   - success screens: items appear in order
   ========================================================= */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@supports not (view-transition-name: none) {
  body { animation: vt-in .45s ease both; }
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes rise-soft { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } }

/* Hero load sequence */
.hero-content > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero-content > .hero-eyebrow { animation-delay: .1s; }
.hero-content > h1 { animation: rise-soft 1s cubic-bezier(.2, .7, .2, 1) .2s both; }
.hero-content > .stitch-hero { animation: sew 1.2s cubic-bezier(.6, 0, .3, 1) .75s both; }
.hero-content > .hero-copy { animation-delay: .55s; }
.hero-content > .hero-actions { animation-delay: .7s; }
.hero-content > .hero-subactions { animation-delay: .8s; }
.hero-content > .hero-info { animation-delay: .9s; }
.hero-photo .hero-bg { animation: photo-in 1.4s ease both; }
@keyframes photo-in { from { opacity: 0; transform: scale(1.04); } }

/* Scroll reveal (homepage) */
html.js :is(.section-title, .about-text > p, .about-photo, .feature, .service-item, .flow-list > li, .gallery-grid > img, .faq-item, .contact-list > div, .contact-actions, .map-area):not(.in) {
  opacity: 0; transform: translateY(18px);
}
.rv { transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }

/* Success screens: children appear one after another */
.seq > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.seq > :nth-child(2) { animation-delay: .18s; }
.seq > :nth-child(3) { animation-delay: .28s; }
.seq > :nth-child(4) { animation-delay: .4s; }
.seq > :nth-child(5) { animation-delay: .5s; }
.seq > :nth-child(6) { animation-delay: .6s; }
.seq > :nth-child(7) { animation-delay: .7s; }
.seq > :nth-child(8) { animation-delay: .8s; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .hero-content > *, .hero-content > h1, .hero-photo .hero-bg, .seq > *, .manage-result { animation: none !important; }
  html.js :is(.section-title, .about-text > p, .about-photo, .feature, .service-item, .flow-list > li, .gallery-grid > img, .faq-item, .contact-list > div, .contact-actions, .map-area):not(.in) { opacity: 1; transform: none; }
  .rv { transition: none; }
}

/* ---------- Faint traditional patterns on the white sections ----------
   特徴 = 籠目 (bamboo basket weave), 来院の流れ = 麻の葉, FAQ = 七宝.
   Drawn as masks so the same tile works in ink by day and white by night. */
.features, .flow, .faq { position: relative; isolation: isolate; --pattern-ink: rgba(28, 28, 28, .055); }
.features::before, .flow::before, .faq::before {
  display: none; /* replaced by the 浸染 corner (.dye) — the faint full pattern now lives in the page background */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--pattern-ink);
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
}
.features::before { -webkit-mask-image: url("images/pattern-kagome.svg"); mask-image: url("images/pattern-kagome.svg"); -webkit-mask-size: 34px auto; mask-size: 34px auto; }
.flow::before     { -webkit-mask-image: url("images/pattern-asanoha.svg"); mask-image: url("images/pattern-asanoha.svg"); -webkit-mask-size: 44px auto; mask-size: 44px auto; }
.faq::before      { -webkit-mask-image: url("images/pattern-shippo.svg"); mask-image: url("images/pattern-shippo.svg"); -webkit-mask-size: 40px auto; mask-size: 40px auto; }
body.night-mode :is(.features, .flow, .faq) { --pattern-ink: rgba(255, 255, 255, .04); }

/* ---------- 下地の和柄 + 浸染 ----------
   One pattern per page, set on <body>:
     body.dye-page                 麻の葉 (home, booking)
     body.dye-page.dye-page-shippo 七宝   (change booking)
     body.dye-page.dye-page-kagome 籠目   (privacy)
   The page background carries it faintly everywhere. White cards / sections
   marked .dye let the SAME pattern seep in from one corner, in bamboo green.
   dye.js lines the tiles up with the background so it reads as one cloth. */
body.dye-page {
  position: relative;
  --pat: url("images/pattern-asanoha.svg"); --pat-size: 46px 79.7px;
}
body.dye-page.dye-page-shippo { --pat: url("images/pattern-shippo.svg"); --pat-size: 42px 42px; }
body.dye-page.dye-page-kagome { --pat: url("images/pattern-kagome.svg"); --pat-size: 36px 62.35px; }
body.dye-page::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(28, 28, 28, .06);
  -webkit-mask-image: var(--pat); mask-image: var(--pat);
  -webkit-mask-size: var(--pat-size); mask-size: var(--pat-size);
  -webkit-mask-position: 0 0; mask-position: 0 0;
}
body.dye-page.night-mode::after { background: rgba(255, 255, 255, .045); }

.dye {
  position: relative; isolation: isolate;
  --dye-ink: rgba(79, 127, 58, .3);
  --dye-w: 460px; --dye-h: 300px; --dye-at: 100% 0;
}
.dye.dye-bl { --dye-at: 0 100%; }
.dye::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: var(--dye-ink);
  -webkit-mask-image: var(--pat), radial-gradient(ellipse var(--dye-w) var(--dye-h) at var(--dye-at), #000 0, #000 25%, rgba(0,0,0,.45) 55%, transparent 100%);
  mask-image: var(--pat), radial-gradient(ellipse var(--dye-w) var(--dye-h) at var(--dye-at), #000 0, #000 25%, rgba(0,0,0,.45) 55%, transparent 100%);
  -webkit-mask-size: var(--pat-size), 100% 100%; mask-size: var(--pat-size), 100% 100%;
  -webkit-mask-repeat: repeat, no-repeat; mask-repeat: repeat, no-repeat;
  /* dye.js sets --dye-ox/--dye-oy so the tiles continue the page background */
  -webkit-mask-position: var(--dye-ox, 0) var(--dye-oy, 0), 0 0; mask-position: var(--dye-ox, 0) var(--dye-oy, 0), 0 0;
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
body.night-mode .dye { --dye-ink: rgba(156, 196, 127, .14); }
@media (max-width: 640px) { .dye { --dye-w: 300px; --dye-h: 220px; } }

/* The three white sections on the home page: a bigger dyed corner. */
.section.dye:is(.features, .flow, .faq) { --dye-w: 720px; --dye-h: 460px; }
@media (max-width: 640px) { .section.dye:is(.features, .flow, .faq) { --dye-w: 360px; --dye-h: 320px; } }
/* Privacy page: the text sits on a white card. */
.policy .container.dye { background: var(--shiro); border: 1px solid var(--rule); border-radius: 12px; padding: clamp(28px, 5vw, 56px); box-shadow: 0 20px 50px rgba(0, 0, 0, .05); }
body.night-mode .policy .container.dye { background: #1d1d1d; }


/* ===== Launch splash (home-screen app only; class set by the inline <head> script) ===== */
html.app-launch::before{
  content:"";position:fixed;inset:0;z-index:2147483646;box-sizing:border-box;
  display:flex;align-items:center;justify-content:center;padding-top:clamp(96px,24vw,128px);
  background:linear-gradient(#9cc47f,#9cc47f) center calc(50% + clamp(30px,7vw,38px)) / 44px 2px no-repeat,#f4f4f1;
  font:500 14px/1 "Zen Kaku Gothic New","Hiragino Sans","Noto Sans JP",sans-serif;letter-spacing:.45em;color:#6b6c66;
  animation:app-splash-out .45s ease 1.1s forwards;
}
html.app-launch.app-admin::before{content:"予約管理"}
html.app-launch::after{
  content:"上高田整骨院";position:fixed;left:0;right:0;top:50%;z-index:2147483647;transform:translateY(-50%);
  text-align:center;padding-left:.2em;
  font:800 clamp(32px,9.5vw,46px)/1.2 "Shippori Mincho B1","Hiragino Mincho ProN","Yu Mincho","Noto Serif JP","Noto Serif CJK JP",serif;
  letter-spacing:.2em;color:#1c1c1c;
  animation:app-splash-text 1.55s ease forwards;
}
html.app-launch.app-launch-night::before{background:linear-gradient(#9cc47f,#9cc47f) center calc(50% + clamp(30px,7vw,38px)) / 44px 2px no-repeat,#141414;color:#a6a8a2}
html.app-launch.app-launch-night::after{color:#ecebe6}
@keyframes app-splash-out{to{opacity:0;visibility:hidden}}
@keyframes app-splash-text{0%{opacity:0;letter-spacing:.34em}28%{opacity:1;letter-spacing:.2em}72%{opacity:1}100%{opacity:0;visibility:hidden}}
@media (prefers-reduced-motion:reduce){
  html.app-launch::before{animation-delay:.8s;animation-duration:.2s}
  html.app-launch::after{animation:app-splash-out .2s ease .8s forwards}
}
