.demo-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 22px;
}

.phone-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-frame {
  width: 344px;
  height: 704px;
  background: #141b2d;
  border-radius: 44px;
  padding: 11px;
  box-shadow: 0 24px 54px rgba(17, 28, 51, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  position: relative;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  color: #111827;
  font-size: 13px;
  line-height: 1.45;
  user-select: none;
}

.phone-statusbar {
  height: 36px;
  padding: 8px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  position: relative;
  flex-shrink: 0;
  z-index: 4;
}

.phone-island {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 84px;
  height: 22px;
  border-radius: 99px;
  background: #0f172a;
}

.phone-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  height: 100%;
  background: #fff;
}

.tab-view.is-active {
  display: flex;
}

.phone-tabbar {
  height: 58px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px 6px 6px;
  flex-shrink: 0;
  z-index: 4;
}

.tab-btn {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  padding: 2px;
  font-family: inherit;
}

.tab-btn.is-active {
  color: #1fa8e0;
}

.tab-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.72;
}

.tab-btn.is-active .tab-icon {
  opacity: 1;
}

/* Real app Map top bar */
.real-topbar {
  background: #fff;
  padding: 6px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  z-index: 3;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
}

.icon-plain-btn {
  border: 0;
  background: transparent;
  color: #111827;
  padding: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-toggle-btn {
  border: 0;
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  background: #1b85a9;
  color: #fff;
  font-family: inherit;
  transition: background 0.15s;
}

.share-toggle-btn.is-sharing {
  background: #c62828;
}

/* Map area */
.map-canvas {
  position: relative;
  flex: 1;
  background: #ebeef3;
  overflow: hidden;
}

.map-grid-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-auto-end {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.72);
  padding: 2px 10px;
  border-radius: 99px;
  z-index: 2;
  white-space: nowrap;
}

.share-nudge {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #1b85a9;
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(27, 133, 169, 0.32);
  z-index: 3;
  font-family: inherit;
}

.share-nudge::after {
  content: "";
  position: absolute;
  top: -5px;
  right: 24px;
  width: 10px;
  height: 10px;
  background: #1b85a9;
  transform: rotate(45deg);
}

.settings-profile-card {
  padding: 12px 14px 4px;
}

.settings-section-title {
  margin: 14px 14px 4px;
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.settings-sub-title {
  margin: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
}

.map-left-stack {
  position: absolute;
  left: 12px;
  top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}

.map-sos-btn {
  width: 44px;
  height: 44px;
  border-radius: 99px;
  border: 0;
  background: #ef4444;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  font-family: inherit;
}

.map-safe-btn {
  width: 44px;
  height: 44px;
  border-radius: 99px;
  border: 0;
  background: #fff;
  color: #16a34a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(17, 24, 39, 0.14);
}

.map-right-stack {
  position: absolute;
  right: 12px;
  top: 38px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}

.map-circle-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 99px;
  border: 0;
  background: #fff;
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(17, 24, 39, 0.14);
}

.bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pins matching real app */
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 2;
  padding: 0;
  font-family: inherit;
}

.pin-pill {
  background: #1f2937;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.pin-name {
  background: #fff;
  color: #111827;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 99px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  white-space: nowrap;
}

.pin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 99px;
  background: #f8fafc;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  position: relative;
  transition: transform 0.15s;
}

.pin-avatar::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #fff;
}

.map-pin.is-selected .pin-avatar {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(31, 168, 224, 0.45), 0 4px 12px rgba(0, 0, 0, 0.22);
}

/* Bottom sheet matching 12-map-status.png */
.map-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 8px 16px 12px;
  box-shadow: 0 -4px 18px rgba(17, 24, 39, 0.1);
  z-index: 3;
}

.sheet-handle {
  width: 34px;
  height: 4px;
  border-radius: 99px;
  background: #cbd5e1;
  margin: 0 auto 8px;
}

.sheet-heading {
  text-align: center;
  font-size: 13px;
  font-weight: 750;
  color: #111827;
  margin-bottom: 8px;
}

.member-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 99px;
  background: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.member-status-info {
  flex: 1;
  min-width: 0;
}

.member-status-name {
  font-weight: 750;
  font-size: 13px;
  color: #111827;
}

.member-status-sub {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-status-time {
  font-size: 11px;
  color: #9ca3af;
}

/* Modals inside phone */
.phone-modal {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 16px;
}

.phone-modal.is-open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 16px 38px rgba(17, 24, 39, 0.25);
}

.modal-card h4 {
  margin: 0 0 12px;
  font-size: 15px;
  text-align: center;
}

/* 02-sharing.png style buttons */
.dur-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.dur-row-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid #2563eb;
  background: #fff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.dur-row-btn.is-active {
  background: #2563eb;
  color: #fff;
}

.share-sub-heading {
  font-size: 13px;
  font-weight: 750;
  margin: 6px 0 4px;
}

.share-sub-desc {
  font-size: 10.5px;
  color: #6b7280;
  margin: 0 0 8px;
  line-height: 1.5;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 12.5px;
  font-weight: 600;
}

.toggle-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 11px;
  color: #6b7280;
}

.switch-btn {
  width: 40px;
  height: 22px;
  border-radius: 99px;
  border: 0;
  background: #d1d5db;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.switch-btn::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.switch-btn.is-on {
  background: #0f8a7d;
}

.switch-btn.is-on::after {
  transform: translateX(18px);
}

/* 08-sos.png full-screen red SOS */
.sos-fullscreen {
  position: absolute;
  inset: 0;
  background: #ee3b3b;
  color: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 12;
  text-align: center;
}

.sos-fullscreen.is-open {
  display: flex;
}

.sos-arc {
  width: 76px;
  height: 76px;
  border-radius: 99px;
  border: 5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-right-color: #fff;
  margin-bottom: -14px;
  animation: sos-spin 1s linear infinite;
}

@keyframes sos-spin {
  to {
    transform: rotate(360deg);
  }
}

.sos-num {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
}

.sos-divider {
  width: 180px;
  height: 1px;
  background: rgba(255, 255, 255, 0.6);
  margin: 12px 0;
}

.sos-cancel-btn {
  margin-top: 28px;
  border: 1.5px solid #fff;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 99px;
  padding: 9px 26px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* 11-talk-list.png + 04-chat.png */
.talk-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.seg-pill {
  background: #f1f5f9;
  border-radius: 99px;
  padding: 2px;
  display: inline-flex;
  align-items: center;
}

.seg-opt {
  border: 0;
  background: transparent;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  color: #4b5563;
  cursor: pointer;
  font-family: inherit;
}

.seg-opt.is-active {
  background: #1fa8e0;
  color: #fff;
}

.plus-circle-btn {
  width: 30px;
  height: 30px;
  border-radius: 99px;
  border: 0;
  background: #1fa8e0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.talk-search {
  margin: 0 14px 10px;
  background: #f1f5f9;
  color: #9ca3af;
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 11.5px;
}

.talk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 0;
  background: #fff;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.talk-row:hover {
  background: #f8fafc;
}

/* Chat detail view matching 04-chat.png */
.chat-detail {
  display: none;
  flex-direction: column;
  height: 100%;
  background: #d8e3ea;
}

.chat-detail.is-open {
  display: flex;
}

.chat-topbar {
  background: #fff;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.chat-back-btn {
  border: 0;
  background: transparent;
  color: #1fa8e0;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  padding: 2px 4px;
  font-family: inherit;
}

.chat-box {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.chat-date-pill {
  align-self: center;
  background: rgba(107, 114, 128, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  padding: 2px 10px;
  border-radius: 99px;
}

.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.bubble-row.me {
  justify-content: flex-end;
}

.bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.45;
}

.bubble.them {
  background: #fff;
  color: #111827;
}

.bubble.me {
  background: #1fa8e0;
  color: #fff;
}

.bubble-meta {
  font-size: 9.5px;
  color: #6b7280;
  white-space: nowrap;
}

.quick-replies {
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-btn {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
  border-radius: 99px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.chat-inputbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
  background: #fff;
  border-top: 1px solid #f1f5f9;
}

.chat-plus {
  width: 28px;
  height: 28px;
  border-radius: 99px;
  background: #f1f5f9;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-input-box {
  flex: 1;
  background: #f1f5f9;
  color: #9ca3af;
  border-radius: 99px;
  padding: 7px 12px;
  font-size: 12px;
}

.chat-send {
  background: #1fa8e0;
  color: #fff;
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 09-safety-modes.png & Settings list */
.subpage-head {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 750;
  border-bottom: 1px solid #f1f5f9;
}

.info-callout {
  margin: 10px 14px;
  background: #f0f9ff;
  border-left: 3px solid #1fa8e0;
  border-radius: 0 10px 10px 0;
  padding: 9px 11px;
  font-size: 11px;
  color: #334155;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 14px 10px;
}

.mode-tab {
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #4b5563;
  border-radius: 10px;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.mode-tab.is-active {
  background: #f0f9ff;
  border-color: #1fa8e0;
  color: #0369a1;
}

.mode-detail-card {
  margin: 0 14px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.settings-group {
  margin: 12px 14px 0;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.settings-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.settings-item:last-child {
  border-bottom: 0;
}

.mini-btn {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #111827;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.mini-btn.primary {
  background: #1fa8e0;
  border-color: #1fa8e0;
  color: #fff;
}

/* Guide column */
.demo-guide {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-card {
  background: #f8f9fe;
  border: 1px solid #e5e9f4;
  border-radius: 18px;
  padding: 16px 18px;
}

.guide-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #17233d;
}

.guide-card p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #485675;
}

.guide-trigger {
  border: 1px solid #d5ddf8;
  background: #fff;
  color: #3649b8;
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.guide-trigger:hover {
  background: #eff2ff;
}

.demo-toast {
  position: absolute;
  top: 44px;
  left: 14px;
  right: 14px;
  background: #111827;
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  z-index: 20;
  display: none;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.25);
}

.demo-toast.is-show {
  display: block;
}

@media (max-width: 900px) {
  .demo-layout {
    grid-template-columns: 1fr;
  }
  .phone-frame {
    width: min(344px, 100%);
  }
}

/* 実在の地図(OpenStreetMap を画像にしたもの)。原寸のまま中央を切り出す */
.map-real {
  object-fit: none;
  object-position: center;
}

.map-attrib {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
  padding: 1px 6px;
  font-size: 9px;
  line-height: 1.5;
  color: #334155;
  background: rgba(255, 255, 255, 0.82);
  border-bottom-left-radius: 6px;
  text-decoration: none;
}

/* 設定・位置履歴は項目が多くてスクロールする。flex の既定だと各ブロックが縮んで文字が切れるので縮めない */
.tab-view[data-tab="settings"] > *,
.tab-view[data-tab="history"] > * {
  flex-shrink: 0;
}

/* 位置履歴 */
.hist-days {
  display: flex;
  gap: 6px;
  padding: 10px 14px 8px;
  overflow-x: auto;
}

.hist-day {
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.hist-day.is-active {
  background: #1fa8e0;
  border-color: #1fa8e0;
  color: #fff;
}

.hist-day.is-locked {
  background: #fff;
  border-style: dashed;
  color: #9ca3af;
}

.hist-map {
  position: relative;
  height: 200px;
  margin: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #ebeef3;
}

.hist-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hist-summary {
  margin: 10px 14px 2px;
  font-size: 12px;
  font-weight: 800;
  color: #0e7490;
}

.hist-list {
  list-style: none;
  margin: 0;
  padding: 0 14px 6px;
}

.hist-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 12.5px;
}

.hist-list li:last-child {
  border-bottom: 0;
}

.hist-time {
  flex: 0 0 38px;
  font-weight: 800;
  color: #111827;
}

.hist-no {
  flex: 0 0 18px;
  height: 18px;
  border-radius: 50%;
  background: #1fa8e0;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hist-name {
  font-weight: 700;
  color: #111827;
}

.hist-sub {
  font-size: 11px;
  color: #6b7280;
}

.hist-note {
  margin: 2px 14px 16px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #6b7280;
}
