:root {
  --osaic-cta: #AA0000;
  --osaic-cta-dark: #880000;
  --osaic-cream: #fffdf7;
  --osaic-border: #ddd7ca;
  --osaic-text: #18202a;
  --osaic-muted: #68717b;
  --osaic-accent: #c56a3b;
  --osaic-shadow: 0 18px 55px rgba(22, 34, 48, .22);
}

html.osaic-no-scroll,
html.osaic-no-scroll body { overflow: hidden !important; }

.osaic-root,
.osaic-root * { box-sizing: border-box; }

.osaic-floating-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 99996;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px 12px 12px;
  background: var(--osaic-cta);
  color: #fff;
  font: 700 15px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  box-shadow: 0 8px 28px rgba(170, 0, 0, .30);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.osaic-floating-button:hover { transform: translateY(-2px); background: var(--osaic-cta-dark); box-shadow: 0 12px 32px rgba(170, 0, 0, .36); }
.osaic-floating-button:focus-visible { outline: 3px solid rgba(170, 0, 0, .30); outline-offset: 3px; }
.osaic-floating-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: var(--osaic-cta);
  font-size: 12px;
}

.osaic-overlay {
  position: fixed;
  inset: 0;
  z-index: 99997;
  background: rgba(16, 25, 35, .48);
  opacity: 0;
  transition: opacity .22s ease;
}
.osaic-overlay.is-open { opacity: 1; }

.osaic-panel {
  position: fixed;
  z-index: 99998;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100vw - 36px));
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, calc(-50% + 16px)) scale(.985);
  opacity: 0;
  border: 1px solid rgba(210, 202, 188, .92);
  border-radius: 22px;
  background: var(--osaic-cream);
  color: var(--osaic-text);
  box-shadow: var(--osaic-shadow);
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  transition: transform .22s ease, opacity .22s ease;
}
.osaic-panel.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.osaic-panel-handle { display: none; }

.osaic-panel-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.osaic-panel-header h2 {
  margin: 0;
  color: var(--osaic-text);
  font-size: 21px;
  line-height: 1.45;
  font-weight: 800;
}
.osaic-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--osaic-border);
  border-radius: 50%;
  background: #fff;
  color: #54606b;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.osaic-close:hover { background: #f3f1eb; }

.osaic-question {
  display: block;
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid #c6bfb5;
  border-radius: 10px;
  background: #fff;
  color: #202831;
  padding: 14px 15px;
  font: 15px/1.65 inherit;
}
.osaic-question::placeholder { color: #9198a0; }
.osaic-question:focus { outline: 3px solid rgba(170, 0, 0, .10); border-color: var(--osaic-cta); }

.osaic-submit-button {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--osaic-cta);
  color: #fff;
  font: 800 16px/1.2 inherit;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.osaic-submit-button:hover { background: var(--osaic-cta-dark); transform: translateY(-1px); }
.osaic-submit-button:focus-visible { outline: 3px solid rgba(170, 0, 0, .25); outline-offset: 2px; }

.osaic-submit-note {
  margin: 12px 0 0;
  color: #5f6871;
  font-size: 12.5px;
  line-height: 1.7;
}

.osaic-divider { height: 1px; background: var(--osaic-border); margin: 22px 0 18px; }
.osaic-phone-block h3 { margin: 0 0 11px; font-size: 16px; line-height: 1.45; font-weight: 800; }
.osaic-phone-button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 9px;
  text-decoration: none !important;
  border-radius: 14px;
  padding: 13px 15px;
  background: var(--osaic-accent);
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(151, 75, 36, .2);
}
.osaic-phone-button > span:first-child { grid-row: 1 / span 2; font-size: 24px; }
.osaic-phone-button > span:nth-child(2) { font-size: 13px; font-weight: 700; }
.osaic-phone-button strong { font-size: 18px; letter-spacing: .03em; }
.osaic-phone-button:hover { filter: brightness(.96); }

.osaic-disclaimer { margin: 14px 2px 0; color: #81878c; font-size: 10.5px; line-height: 1.65; }
.osaic-toast {
  width: 100%;
  margin-top: 10px;
  border-radius: 10px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  background: #1f2933;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  transition: all .2s ease;
}
.osaic-toast.is-visible { padding: 10px 12px; max-height: 90px; opacity: 1; }

@media (max-width: 640px) {
  .osaic-floating-button { right: 14px; bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px)); padding: 10px 14px 10px 10px; }
  .osaic-floating-icon { width: 30px; height: 30px; }
  .osaic-panel {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(88vh, 720px);
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    padding: 11px 18px max(18px, calc(env(safe-area-inset-bottom) + 12px));
    transform: translateY(102%);
    opacity: 1;
  }
  .osaic-panel.is-open { transform: translateY(0); }
  .osaic-panel-handle { display: block; width: 44px; height: 4px; border-radius: 999px; background: #d5d0c9; margin: 0 auto 12px; }
  .osaic-panel-header { margin-bottom: 14px; }
  .osaic-panel-header h2 { font-size: 18px; }
  .osaic-question { min-height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .osaic-panel, .osaic-overlay, .osaic-floating-button, .osaic-submit-button { transition: none !important; }
}

.osaic-privacy-note {
    margin: -2px 0 12px;
    font-size: 13px;
    line-height: 1.7;
    color: #666;
}
