:root {
  --seat-pink: #ff4fa3;
  --seat-pink-strong: #ff007f;
  --seat-cyan: #00c9e8;
  --ink: #1b2330;
}

* { box-sizing: border-box; }
button, select, input, .nav-icon, .field-label { flex-shrink: 0; white-space: nowrap; }
.selected-pill { flex-shrink: 1; }

.app-shell { width: min(1260px, calc(100vw - 28px)); margin: 0 auto; padding: 28px 0 44px; }
.hero { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:18px; padding:22px clamp(18px,4vw,34px); margin-bottom:18px; background:rgba(255,255,255,.38); }
.eyebrow { margin:0 0 6px; font-size:.78rem; font-weight:900; letter-spacing:.14em; text-transform:uppercase; color:var(--seat-pink-strong); }
.hero h1 { margin:0; font-size:clamp(1.7rem,4vw,3.2rem); line-height:1.05; font-weight:900; letter-spacing:-.04em; }
.lead { margin:10px 0 0; color:var(--text-sec); font-weight:600; line-height:1.65; }
.hero-copy { min-width: 0; }
.hero-actions { justify-self:end; display:flex; align-items:end; gap:8px; padding-top:2px; margin-inline-end:clamp(8px,1.8vw,22px); }
.lang-label { font-size:.76rem; color:var(--seat-pink-strong); }
.lang-input { width:170px; min-width:170px; min-height:40px; }
.hero-badge { width:74px; height:74px; border-radius:28px; display:grid; place-items:center; color:#fff; font-size:2rem; font-weight:900; background:linear-gradient(135deg,var(--seat-pink),#ff8ec4 48%,var(--seat-cyan)); box-shadow:0 18px 44px rgba(255,0,127,.26); }
.workspace { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:18px; align-items:start; }
.map-card,.control-card { background:rgba(255,255,255,.42); }
.map-card { padding:14px; border-radius:24px; box-shadow:0 8px 24px rgba(27,35,48,.06); }
.map-toolbar { display:flex; align-items:center; justify-content:flex-start; gap:10px; margin-bottom:12px; }
.selected-pill { width:100%; min-width:0; max-width:100%; padding:10px 14px; border-radius:999px; background:rgba(255,255,255,.8); border:1px solid rgba(255,79,163,.22); color:var(--ink); font-size:.92rem; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:normal; line-height:1.45; }
.map-scroll { width:100%; overflow:auto; padding:10px; border-radius:22px; background:rgba(255,255,255,.58); border:1px solid rgba(255,255,255,.7); overscroll-behavior:contain; }
.map-stage { position:relative; width:min(100%,920px); max-width:none; min-width:0; margin:0 auto; aspect-ratio:760 / 640; user-select:none; transform-origin:top center; }
.seatmap-base,.seat-overlay { position:absolute; inset:0; width:100%; height:100%; }
.seatmap-base { object-fit:contain; border-radius:14px; background:#fff; filter:drop-shadow(0 14px 32px rgba(27,35,48,.08)); }
.seat-overlay { z-index:2; overflow:visible; }
.seat-hit { cursor:pointer; fill:rgba(255,79,163,.01); stroke:transparent; stroke-width:1.6; transition:fill .16s ease, stroke .16s ease, filter .16s ease, transform .16s ease; transform-box:fill-box; transform-origin:center; }
.seat-hit:hover,.seat-hit.is-selected { fill:rgba(255,79,163,.34); stroke:#ff007f; filter:url(#seatGlow); transform:scale(1.08); }
.selection-rect { fill:rgba(255,0,127,.26); stroke:#ff007f; stroke-width:2.8; filter:url(#selectionGlow); animation:selectedPulse 1.15s ease-in-out infinite; }
@keyframes selectedPulse { 0%,100%{opacity:.86;} 50%{opacity:1;} }
.arrow-callout { pointer-events:none; filter:url(#arrowGlow); }
.arrow-callout .arrow-body { fill:#ff007f; stroke:#fff; stroke-width:3; }
.arrow-callout .arrow-label-bg { fill:rgba(255,255,255,.97); stroke:#ff007f; stroke-width:1.6; }
.arrow-callout text { fill:#ff007f; font-size:12px; font-weight:900; text-anchor:middle; dominant-baseline:middle; font-family:'Noto Sans JP',sans-serif; }
.control-card { position:sticky; top:calc(18px + env(safe-area-inset-top)); padding:18px; display:flex; flex-direction:column; gap:16px; }
.control-card.apple-glass-3d { --rx:0deg; --ry:0deg; }
.control-section { display:flex; flex-direction:column; gap:7px; }
.field-label { font-size:.82rem; font-weight:900; color:var(--text-main); }
.control-input { width:100%; min-height:44px; border:1px solid rgba(255,64,129,.18); border-radius:15px; padding:0 13px; background:rgba(255,255,255,.86); color:var(--text-main); font:inherit; font-weight:700; outline:none; box-shadow:inset 0 1px 0 rgba(255,255,255,.8); }
.control-input:focus { border-color:var(--seat-pink); box-shadow:0 0 0 4px rgba(255,79,163,.13); }
.summary-box { padding:14px; border-radius:20px; background:rgba(255,255,255,.72); border:1px solid rgba(255,64,129,.16); }
.summary-label { margin:0 0 4px; font-size:.74rem; color:var(--seat-pink-strong); font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.summary-main { margin:0; font-size:1.18rem; font-weight:900; color:var(--ink); line-height:1.3; }
.summary-sub { margin:8px 0 0; color:var(--text-sec); font-size:.9rem; line-height:1.55; }
.button-row { display:grid; grid-template-columns:1fr .82fr; gap:10px; }
.primary-button,.secondary-button,.ghost-button,.link-button { min-height:44px; border:none; border-radius:16px; padding:0 15px; font:inherit; font-weight:900; cursor:pointer; transition:transform .16s ease, box-shadow .16s ease, opacity .16s ease; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }
.primary-button { color:#fff; background:linear-gradient(135deg,#ff007f,#ff6faf 56%,#00c9e8); box-shadow:0 14px 32px rgba(255,0,127,.26); }
.secondary-button,.ghost-button { color:var(--seat-pink-strong); background:rgba(255,255,255,.82); border:1px solid rgba(255,64,129,.2); }
.link-button { width:100%; color:var(--ink); background:rgba(255,255,255,.55); border:1px dashed rgba(255,64,129,.35); }
.primary-button:hover,.secondary-button:hover,.ghost-button:hover,.link-button:hover { transform:translateY(-1px); box-shadow:0 12px 26px rgba(27,35,48,.1); }
button:disabled { opacity:.48; cursor:not-allowed; transform:none!important; }
.notes { padding:12px 13px; border-radius:16px; background:rgba(0,201,232,.09); color:#25718a; font-size:.84rem; font-weight:700; line-height:1.6; }
.notes p { margin:0; }
.modal-backdrop { position:fixed; inset:0; z-index:10000; display:none; place-items:center; padding:24px; background:rgba(20,28,38,.44); backdrop-filter:blur(10px); }
.modal-backdrop:not([hidden]) { display:grid; }
.modal-backdrop[hidden] { display:none!important; }
.export-modal { width:min(620px,100%); max-height:min(88dvh,900px); overflow:auto; padding:22px; background:rgba(255,255,255,.88); text-align:center; }
.export-modal h2 { margin:4px 0 8px; font-size:1.45rem; font-weight:900; }
.export-modal p { margin:0 0 14px; color:var(--text-sec); font-weight:700; }
.modal-close { position:sticky; top:0; margin-left:auto; display:grid; place-items:center; width:38px; height:38px; border-radius:999px; border:0; background:rgba(255,255,255,.9); color:var(--ink); font-size:1.4rem; font-weight:900; cursor:pointer; }
.export-preview { display:block; width:100%; max-height:62dvh; object-fit:contain; border-radius:16px; background:#fff; box-shadow:0 16px 40px rgba(27,35,48,.16); -webkit-user-select:auto; user-select:auto; }
.modal-link { margin-top:14px; }
.toast { position:fixed; left:50%; bottom:calc(24px + env(safe-area-inset-bottom)); z-index:10001; transform:translateX(-50%) translateY(20px); padding:12px 16px; border-radius:999px; background:rgba(27,35,48,.92); color:#fff; font-weight:800; opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease; }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
@media (max-width:980px) { .workspace { grid-template-columns:1fr; } .control-card { position:static; } .map-stage { width:100%; min-width:0; } }
@media (max-width:560px) {
  .app-shell { width:100%; max-width:100%; padding:12px 10px 34px; }
  .hero { grid-template-columns:1fr; align-items:stretch; gap:14px; padding:18px 16px; border-radius:22px; }
  .hero h1 { font-size:clamp(1.85rem,9vw,2.55rem); line-height:1.08; white-space:normal; overflow-wrap:keep-all; }
  .lead { font-size:.95rem; line-height:1.6; }
  .hero-actions { justify-self:stretch; width:100%; align-items:stretch; flex-direction:column; gap:6px; margin-inline-end:0; }
  .lang-input { width:100%; min-width:0; }
  .map-card,.control-card { border-radius:22px; }
  .map-toolbar { align-items:stretch; flex-direction:column; }
  .map-scroll { padding:7px; }
  .map-stage { min-width:0; }
  .button-row { grid-template-columns:1fr; }
}


.site-footer {
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(255,255,255,.46);
  border-radius: 22px;
  color: var(--text-sec);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.7;
}
.site-footer p { margin: 0; }


/* v3.2.0 mobile / background stability fixes */
html, body {
  min-height: 100%;
  overflow-x: hidden;
}
body {
  animation: none !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,79,163,.18), transparent 34rem),
    radial-gradient(circle at 90% 8%, rgba(0,201,232,.14), transparent 30rem),
    linear-gradient(135deg, #fff7fb 0%, #eef8ff 52%, #ffffff 100%) !important;
  background-size: cover !important;
  background-attachment: fixed;
}
.site-footer {
  width: 100%;
  max-width: 100%;
}
.site-footer p {
  white-space: normal;
  overflow-wrap: break-word;
}
@media (max-width:560px) {
  .site-footer {
    width: 100%;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: .76rem;
    line-height: 1.65;
  }
  .site-footer p {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}


/* v3.3.0 mobile zoom / overflow / Safari preview fixes */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}
.app-shell,
.hero,
.workspace,
.map-card,
.control-card,
.site-footer,
.map-toolbar,
.summary-box,
.notes {
  max-width: 100%;
  min-width: 0;
}
button, select, input, textarea {
  max-width: 100%;
}
.map-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.map-scroll {
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  contain: layout paint;
}
.map-stage {
  max-width: none !important;
  min-width: 0 !important;
  will-change: width;
}
.zoom-control {
  display: inline-grid;
  grid-template-columns: 40px minmax(52px, auto) 40px;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,64,129,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.zoom-button {
  width: 40px;
  height: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,79,163,.12);
  color: var(--seat-pink-strong);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.zoom-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.zoom-level {
  min-width: 52px;
  text-align: center;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}
.modal-backdrop {
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  overflow: auto;
}
.export-modal {
  width: min(620px, calc(100vw - 24px));
  max-width: 100%;
}
.export-preview {
  max-width: 100%;
  height: auto;
  -webkit-touch-callout: default !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
}
.modal-link { display: none !important; }
@media (max-width: 560px) {
  button, select, input, textarea, .field-label {
    min-width: 0;
  }
  .app-shell {
    width: 100%;
    max-width: 100vw;
    padding-left: 10px;
    padding-right: 10px;
  }
  .hero,
  .map-card,
  .control-card,
  .site-footer {
    width: 100%;
    max-width: calc(100vw - 20px);
  }
  .map-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .zoom-control {
    justify-self: center;
    width: min(100%, 178px);
  }
  .map-scroll {
    width: 100%;
    padding: 6px;
    overflow: auto;
  }
  .primary-button,
  .secondary-button,
  .link-button {
    white-space: normal;
    line-height: 1.3;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .summary-main,
  .summary-sub,
  .notes p,
  .lead {
    overflow-wrap: anywhere;
  }
  body {
    background-attachment: scroll !important;
  }
}
