:root {
  --bg: #dcecff;
  --bg-accent: #f3fbff;
  --card: rgba(255, 255, 255, 0.18);
  --card-strong: rgba(255, 255, 255, 0.28);
  --text: #0f1f33;
  --muted: #4d6480;
  --line: rgba(255, 255, 255, 0.28);
  --brand: #58aee8;
  --brand-deep: #247db6;
  --ok: #1f8a73;
  --warn: #c97b2c;
  --idle: #69839f;
  --shadow: 0 24px 70px rgba(44, 88, 128, 0.18);
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(134, 208, 255, 0.42), transparent 22%),
    radial-gradient(circle at 20% 80%, rgba(186, 233, 255, 0.36), transparent 26%),
    linear-gradient(155deg, #d7ebff 0%, #eef9ff 46%, #dff2ff 100%);
  min-height: 100vh;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 12px 12px 28px;
}

.panel {
  backdrop-filter: blur(22px) saturate(145%);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 0.95;
}

.brand-mark {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: rgba(9, 28, 49, 0.96);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 28px rgba(42, 118, 175, 0.14);
}

.lede {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.status-chip.status-ok {
  color: var(--ok);
}

.status-chip.status-idle {
  color: var(--idle);
}

.status-chip.status-warn {
  color: var(--brand-deep);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 14px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.camera-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.icon-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.52);
  color: rgba(9, 28, 49, 0.96);
  font-weight: 700;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 22px rgba(70, 129, 175, 0.14);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.66);
}

.icon-button:active {
  transform: translateY(1px);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(111, 193, 242, 0.92) 0%, rgba(42, 132, 190, 0.96) 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(71, 149, 204, 0.28);
}

.ghost-button-secondary {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.ghost-button:disabled {
  opacity: 0.5;
}

.camera-panel {
  overflow: hidden;
}

.camera-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 10px;
  aspect-ratio: 9 / 15;
  background: linear-gradient(180deg, rgba(19, 39, 60, 0.9), rgba(40, 78, 112, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.camera-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay-layer {
  position: absolute;
  inset: 0;
}

.crosshair {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.08);
  position: relative;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.crosshair::before {
  width: 1px;
  height: 120px;
}

.crosshair::after {
  width: 120px;
  height: 1px;
}

.camera-hint {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  color: #fff;
  font-size: 0.82rem;
  text-align: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.demo-sheet {
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 84px;
  width: min(calc(100% - 28px), 360px);
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.18);
  color: #f8fcff;
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow: 0 18px 44px rgba(44, 88, 128, 0.18);
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transform: translateX(-50%);
}

.hidden-sheet {
  display: none;
}

.demo-sheet-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(233, 247, 255, 0.92);
}

.demo-sheet-copy {
  margin: 10px 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(238, 248, 255, 0.92);
}

.demo-sheet-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.camera-footer {
  display: grid;
  gap: 8px;
}

.compact-meta {
  margin-top: 0;
}

.message-count {
  color: var(--muted);
  font-size: 0.88rem;
}

.composer-actions {
  display: grid;
  gap: 8px;
}

.overlay-tag {
  --overlay-text: var(--text);
  --overlay-meta: var(--muted);
  --overlay-background: rgba(255, 255, 255, 0.24);
  --overlay-border: rgba(255, 255, 255, 0.24);
  position: absolute;
  width: min(56vw, 240px);
  min-height: 72px;
  transform: translate(-50%, -50%);
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--overlay-background);
  color: var(--overlay-text);
  border: 1px solid var(--overlay-border);
  box-shadow: 0 16px 34px rgba(53, 101, 145, 0.16);
  backdrop-filter: blur(16px) saturate(145%);
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  transition:
    left 220ms ease-out,
    top 220ms ease-out,
    opacity 220ms ease-out,
    background-color 220ms ease-out;
  will-change: left, top, opacity;
}

.overlay-tag strong {
  display: block;
  font-size: 0.86rem;
  line-height: 1.25;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.overlay-tag span {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--overlay-meta);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-tag.overlay-tag-own {
  box-shadow: 0 18px 38px rgba(53, 101, 145, 0.22);
}

.overlay-tag.overlay-tag-landmark {
  box-shadow: 0 18px 42px rgba(173, 124, 39, 0.28);
}

.overlay-tag.overlay-tag-faint {
  opacity: 0.66;
}

.overlay-tag.overlay-tag-edge {
  background: rgba(255, 255, 255, 0.16);
}

.overlay-empty {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Edge indicators for off-screen (behind) messages */
.edge-indicator {
  --edge-text: #fff;
  --edge-bg: rgba(255, 255, 255, 0.18);
  --edge-border: rgba(255, 255, 255, 0.28);
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 14px;
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
  backdrop-filter: blur(14px) saturate(130%);
  color: var(--edge-text);
  pointer-events: auto;
  cursor: pointer;
  max-width: 44%;
  transition:
    top 220ms ease-out,
    opacity 220ms ease-out;
  will-change: top, opacity;
}

.edge-indicator-left {
  left: 4px;
}

.edge-indicator-right {
  right: 4px;
}

.edge-indicator-arrow {
  font-size: 0.68rem;
  opacity: 0.85;
  flex-shrink: 0;
}

.edge-indicator-title {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edge-indicator-meta {
  font-size: 0.66rem;
  opacity: 0.78;
  flex-shrink: 0;
  white-space: nowrap;
}

.edge-indicator-landmark {
  --edge-text: #214f74;
  --edge-bg: rgba(255, 230, 166, 0.78);
  --edge-border: rgba(255, 230, 166, 0.92);
}

.compact-grid {
  margin-bottom: 12px;
}

.composer-grid {
  gap: 10px 12px;
}

.composer-card {
  display: grid;
  gap: 12px;
}

.composer-head {
  display: grid;
  gap: 4px;
}

.message-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 100px;
  backdrop-filter: blur(10px);
}

.primary-button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(111, 193, 242, 0.98) 0%, rgba(42, 132, 190, 0.98) 100%);
  color: #fff;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(67, 146, 201, 0.3);
}

.composer-subnote {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.post-feedback {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(31, 138, 115, 0.12);
  color: var(--ok);
  font-size: 0.84rem;
  font-weight: 700;
}

.post-feedback.note-warn {
  background: rgba(201, 123, 44, 0.12);
  color: var(--warn);
}

.hidden-feedback {
  display: none;
}

.privacy-note {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(201, 123, 44, 0.12);
  color: #8d5414;
  font-size: 0.82rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
  font: inherit;
  backdrop-filter: blur(10px);
}

.field input[type="range"] {
  padding: 0;
}

.field input[type="color"] {
  min-height: 48px;
  padding: 6px;
}

.field input[readonly] {
  background: rgba(255, 255, 255, 0.14);
}

.inline-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.inline-note.note-warn {
  color: var(--warn);
  font-weight: 700;
}

.inline-note.note-ok {
  color: var(--ok);
}

.hidden-output {
  display: none;
}

.hidden-field,
.hidden-field-grid {
  opacity: 0.72;
}

.output {
  margin: 0;
  min-height: 120px;
  border-radius: var(--radius-md);
  padding: 14px;
  overflow: auto;
  background: rgba(16, 33, 49, 0.62);
  color: #f2f9ff;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
}

.output-compact {
  min-height: 88px;
}

.nearby-list-panel summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.nearby-list-panel summary::-webkit-details-marker {
  display: none;
}

.nearby-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.nearby-list-empty {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.nearby-list-empty.hidden-feedback {
  display: none;
}

.nearby-list-item {
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 28px rgba(53, 101, 145, 0.1);
}

.nearby-list-item-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.nearby-list-item-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.utility-panel {
  padding-top: 14px;
}

.utility-panel summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  margin-bottom: 14px;
}

.utility-panel summary::-webkit-details-marker {
  display: none;
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini-panel {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
}

.compact-head {
  align-items: flex-start;
  flex-direction: column;
}

.compact-field {
  margin-bottom: 10px;
}

.compact-utility-grid {
  gap: 8px;
}

.utility-meta {
  margin-bottom: 10px;
}

.action-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.message-action-sheet {
  position: fixed;
  inset: auto 12px 12px;
  z-index: 20;
}

.message-action-card {
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 26px 56px rgba(44, 88, 128, 0.28);
  backdrop-filter: blur(18px) saturate(140%);
}

.message-action-eyebrow {
  margin: 0 0 8px;
  color: var(--brand-deep);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.message-action-text,
.message-action-meta {
  margin: 0;
}

.message-action-text {
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.5;
}

.message-action-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.message-action-buttons {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.message-delete-button {
  background: linear-gradient(135deg, #e07d52 0%, #c84f4f 100%);
}

.app-notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.app-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px 10px 24px;
  }

  .demo-sheet {
    bottom: 72px;
    width: min(calc(100% - 24px), 340px);
    padding: 14px;
  }

  .panel-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .panel-wide,
  .field-span-2 {
    grid-column: auto;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .camera-topbar {
    flex-direction: column;
  }

  .utility-grid {
    grid-template-columns: 1fr;
  }

  .action-row {
    width: 100%;
  }

  .ghost-button {
    width: 100%;
  }

  .message-action-sheet {
    inset: auto 10px 10px;
  }
}