:root {
  --page-top: #f6ece2;
  --page-bottom: #fbf6f0;
  --shell-top: #fdf8f3;
  --shell-bottom: #f6ece2;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.97);
  --input-bg: #f7efe7;
  --panel: #ffffff;
  --panel-strong: #efe3d6;
  --panel-accent: rgba(168, 107, 67, 0.16);
  --panel-accent-line: rgba(116, 69, 46, 0.35);
  --map-bg: #eadccc;
  --float-bg: rgba(255, 255, 255, 0.96);
  --float-line: rgba(60, 35, 20, 0.18);
  --float-hover: #ecd9c7;
  --float-shadow: 0 8px 16px rgba(60, 35, 20, 0.22);
  --photo-a: #e6d3c0;
  --photo-b: #f6ece2;
  --link: #8a4f2c;
  --close-bg: rgba(60, 35, 20, 0.08);
  --text: #2a1a12;
  --muted: #6f5a4a;
  --line: rgba(60, 35, 20, 0.14);
  --green: #a86b43;
  --green-strong: #74452e;
  --green-soft: rgba(133, 78, 43, 0.22);
  --shadow: 0 12px 28px rgba(60, 35, 20, 0.14);
  --shadow-sm: 0 6px 16px rgba(60, 35, 20, 0.1);
  --sheet-shadow: 0 -14px 32px rgba(60, 35, 20, 0.22);
  --danger: #c4472f;
  --amber: #9a6500;
  --gear-light: #f6dcc4;
  --gear-mid: #c98b5a;
  --gear-dark: #74452e;
  --gear-hole-light: #78665a;
  --gear-hole-dark: #1c120d;
  --scheme: light;
  --panel-radius: 20px;
  color-scheme: light dark;
}

/* 配色は、設定で「ライト」「ダーク」を選ぶとその配色に固定（data-theme）。「自動」は端末の設定に従う。
   ダークの色は2か所に同じものを書く必要があるので、変えるときは両方そろえる */
:root[data-theme='light'] {
  color-scheme: light;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page-top: #17110e;
  --page-bottom: #261812;
  --shell-top: #211611;
  --shell-bottom: #17110e;
  --surface: #241914;
  --surface-glass: rgba(36, 25, 20, 0.97);
  --input-bg: #17110e;
  --panel: rgba(48, 32, 25, 0.96);
  --panel-strong: #302019;
  --panel-accent: rgba(113, 67, 40, 0.48);
  --panel-accent-line: rgba(190, 125, 79, 0.36);
  --map-bg: #3a281f;
  --float-bg: rgba(36, 25, 20, 0.94);
  --float-line: rgba(255, 235, 218, 0.2);
  --float-hover: #74452e;
  --float-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
  --photo-a: #4a3023;
  --photo-b: #241712;
  --link: #e0a477;
  --close-bg: rgba(220, 238, 224, 0.1);
  --text: #fff8f1;
  --muted: #c2aa98;
  --line: rgba(255, 235, 218, 0.14);
  --green: #a86b43;
  --green-strong: #74452e;
  --green-soft: rgba(133, 78, 43, 0.3);
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.2);
  --sheet-shadow: 0 -22px 40px rgba(0, 0, 0, 0.42);
  --danger: #e56d53;
  --amber: #e1a43a;
  --gear-light: #f6dcc4;
  --gear-mid: #d19a6c;
  --gear-dark: #8a5636;
  --gear-hole-light: #a8917f;
  --gear-hole-dark: #120b08;
  --scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --page-top: #17110e;
    --page-bottom: #261812;
    --shell-top: #211611;
    --shell-bottom: #17110e;
    --surface: #241914;
    --surface-glass: rgba(36, 25, 20, 0.97);
    --input-bg: #17110e;
    --panel: rgba(48, 32, 25, 0.96);
    --panel-strong: #302019;
    --panel-accent: rgba(113, 67, 40, 0.48);
    --panel-accent-line: rgba(190, 125, 79, 0.36);
    --map-bg: #3a281f;
    --float-bg: rgba(36, 25, 20, 0.94);
    --float-line: rgba(255, 235, 218, 0.2);
    --float-hover: #74452e;
    --float-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
    --photo-a: #4a3023;
    --photo-b: #241712;
    --link: #e0a477;
    --close-bg: rgba(220, 238, 224, 0.1);
    --text: #fff8f1;
    --muted: #c2aa98;
    --line: rgba(255, 235, 218, 0.14);
    --green: #a86b43;
    --green-strong: #74452e;
    --green-soft: rgba(133, 78, 43, 0.3);
    --shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.2);
    --sheet-shadow: 0 -22px 40px rgba(0, 0, 0, 0.42);
    --danger: #e56d53;
    --amber: #e1a43a;
    --gear-light: #f6dcc4;
    --gear-mid: #d19a6c;
    --gear-dark: #8a5636;
    --gear-hole-light: #a8917f;
    --gear-hole-dark: #120b08;
    --scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: linear-gradient(180deg, var(--page-top) 0%, var(--page-bottom) 100%);
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  background: var(--page-top);
  color: var(--text);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--shell-top) 0%, var(--shell-bottom) 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-shell > * {
  /* Flex items default to min-width: auto, which lets a child's own
     content (e.g. nested grid text) force it wider than the viewport
     instead of shrinking to fit. */
  min-width: 0;
}

.topbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  padding: 4px 2px 0;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar-actions {
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

/* 歯車アイコンの立体感（影）と、押した時の回転 */
.gear {
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.4));
  transition: transform 0.4s ease;
}

.icon-button:hover .gear,
.icon-button:focus-visible .gear {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .gear {
    transition: none;
  }
}

.icon-button:hover,
.icon-button:focus-visible {
  background: transparent;
  color: var(--link);
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

h1 {
  min-width: 0;
  white-space: nowrap;
  margin: 2px 0 0;
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  line-height: 1.1;
}

.google-button {
  flex: 0 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

#googleLoginText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.google-mark {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Google 公式の「G」ロゴ。暗い配色でも見えるように白い丸の上に置く */
.google-mark-inner {
  width: 100%;
  height: 100%;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

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

.summary-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.summary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.summary-item.accent {
  background: var(--panel-accent);
  border-color: var(--panel-accent-line);
}

.value {
  font-size: 1.25rem;
  font-weight: 800;
}

.label {
  font-size: 0.7rem;
  color: var(--muted);
}

.map-panel {
  position: relative;
  border-radius: var(--panel-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-height: 360px;
}

#map {
  height: 360px;
  width: 100%;
  background: var(--map-bg);
}

.leaflet-control-attribution {
  font-size: 10px;
}

.fab {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--float-line);
  border-radius: 50%;
  background: var(--float-bg);
  color: var(--text);
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  box-shadow: var(--float-shadow);
  z-index: 500;
}

.fab-label {
  font-size: 6px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.fab-icon {
  display: block;
  font-size: 1.1rem;
  line-height: 1;
}

.fab:hover,
.fab:focus-visible {
  background: var(--float-hover);
}

.locate-button {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--float-line);
  border-radius: 50%;
  background: var(--float-bg);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: var(--float-shadow);
  z-index: 500;
}

.locate-button:hover,
.locate-button:focus-visible {
  background: var(--float-hover);
}

.album-button {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--float-line);
  border-radius: 50%;
  background: var(--float-bg);
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: var(--float-shadow);
  z-index: 500;
}

.album-button:hover,
.album-button:focus-visible {
  background: var(--float-hover);
}

.hidden-file-input {
  display: none;
}

.list-panel {
  background: var(--surface-glass);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 14px 14px 10px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-header h2 {
  margin: 0;
  font-size: 1rem;
}

.compact {
  margin-bottom: 12px;
}

.text-button {
  border: none;
  background: transparent;
  color: var(--link);
  font-weight: 700;
  padding: 0;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 10px;
  align-items: center;
}

.record-photo {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--photo-a), var(--photo-b));
}

.photo-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  margin-top: 6px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.photo-preview.hidden {
  display: none;
}

.location-status {
  margin: 8px 0 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted);
}

.location-status.error {
  color: var(--danger);
}

.location-status.approximate {
  color: var(--amber);
}

.location-status.hidden {
  display: none;
}

.location-hint {
  margin: 6px 0 0;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.85;
}

.record-main {
  min-width: 0;
}

.record-title {
  margin: 0 0 5px;
  font-size: 0.9rem;
  font-weight: 700;
}

.record-meta,
.record-time {
  color: var(--muted);
  font-size: 0.72rem;
}

.record-time {
  text-align: right;
}

.record-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
}

.custom-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 16px rgba(15, 24, 18, 0.18);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface-glass);
  color: var(--text);
  box-shadow: var(--shadow);
}

.record-popup {
  min-width: 180px;
  max-width: 220px;
  font-family: "Noto Sans JP", sans-serif;
}

.record-popup img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 8px;
  display: block;
}

.record-popup h4 {
  margin: 0 0 4px;
  font-size: 0.82rem;
}

.record-popup p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
}

.popup-detail-button {
  width: 100%;
  margin-top: 10px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green), var(--green-strong));
  color: white;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 0.72rem;
}

.detail-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 460px);
  background: var(--surface-glass);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--sheet-shadow);
  border: 1px solid var(--line);
  z-index: 1100;
  overflow: hidden;
}

.record-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1200;
}

.record-modal.hidden,
.detail-sheet.hidden {
  display: none;
}

.record-modal-card {
  width: min(100%, 460px);
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 16px 16px 30px;
  box-shadow: var(--sheet-shadow);
}

.settings-card {
  max-height: min(86vh, 720px);
  overflow-y: auto;
}

.settings-card .eyebrow {
  margin-bottom: 2px;
}

.settings-card h3 {
  margin: 0;
}

.settings-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.language-section {
  margin-top: 16px;
}

.language-select {
  width: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  padding: 7px 10px;
  color-scheme: var(--scheme);
}

.install-section h4 {
  margin: 0;
  font-size: 0.95rem;
}

.install-description,
.install-url,
.install-guide-item p {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.install-description {
  margin: 8px 0 12px;
}

.qr-wrap {
  width: 168px;
  height: 168px;
  margin: 0 auto;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
}

.install-qr {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.install-url {
  margin: 8px 0 14px;
  overflow-wrap: anywhere;
  text-align: center;
}

.install-guide {
  display: grid;
  gap: 10px;
}

.install-guide-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
}

.install-guide-item strong {
  color: var(--text);
  font-size: 0.8rem;
}

.install-guide-item p {
  margin: 4px 0 0;
}

.privacy-link-row {
  margin: 16px 0 0;
  text-align: center;
}

.privacy-link {
  color: var(--muted);
  font-size: 0.75rem;
}

.settings-section h4 {
  margin: 0;
  font-size: 0.95rem;
}

.settings-count {
  color: var(--muted);
  font-size: 0.72rem;
}

.settings-category-list {
  display: grid;
  gap: 8px;
}

.settings-category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
}

.settings-category-item .color-dot {
  flex: 0 0 auto;
}

.settings-category-item.editing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.category-edit-input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.category-edit-color {
  width: 38px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
}

.category-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.category-edit-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}

.category-edit-actions .category-edit-save {
  background: #2f9b62;
  color: #fff;
}

.category-edit-actions .category-edit-delete {
  background: #a8443d;
  color: #fff;
  border-color: rgba(255, 170, 160, 0.28);
}

.settings-category-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 700;
}

.category-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.category-form .primary-button {
  grid-column: 1 / -1;
}

.color-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.color-field input {
  width: 58px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
}

.record-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.record-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.record-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-email {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  color-scheme: var(--scheme);
  accent-color: var(--green);
  padding: 12px 14px;
  font-family: inherit;
  /* iOS Safari auto-zooms into any input/select with a computed font-size
     under 16px, so this can't just inherit the 0.8rem .field size. */
  font-size: 16px;
}

.date-calendar {
  margin-top: 6px;
  padding: 12px;
  border: 1px solid rgba(190, 125, 79, 0.34);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  box-shadow: var(--shadow);
}

.date-calendar.hidden {
  display: none;
}

.calendar-header,
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-header {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-title {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-nav,
.calendar-day {
  border: none;
  color: var(--text);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
}

.calendar-nav {
  width: 30px;
  height: 30px;
  color: var(--link);
  font-size: 1.1rem;
}

.calendar-nav:hover,
.calendar-day:hover {
  background: rgba(168, 107, 67, 0.26);
}

.calendar-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  text-align: center;
}

.calendar-day {
  min-height: 32px;
  font-size: 0.75rem;
}

.calendar-day.selected {
  background: #a86b43;
  color: #fff;
  font-weight: 800;
}

.drive-pill {
  background: var(--green-soft);
  border: 1px solid rgba(43, 156, 106, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--green-strong);
  font-weight: 700;
}

.primary-button {
  margin-top: 6px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--green-strong));
  color: white;
  font-weight: 800;
  padding: 14px 18px;
}

.detail-sheet-header {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px 0;
}

.close-detail {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--close-bg);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text);
}

.detail-image {
  display: block;
  width: calc(100% - 24px);
  margin: 8px auto 0;
  height: 220px;
  border-radius: 18px;
  object-fit: cover;
}

.detail-content {
  padding: 14px 16px 26px;
}

.detail-badge {
  margin-top: 0;
}

.detail-content h3 {
  margin: 10px 0 6px;
  font-size: 1.2rem;
}

.detail-place {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.75rem;
}

.detail-notes {
  margin-top: 14px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text);
}

.detail-actions,
.detail-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.detail-actions button,
.detail-edit-actions button {
  flex: 1;
}

.secondary-button,
.danger-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.secondary-button {
  background: var(--panel-strong);
}

.danger-button {
  background: #a8443d;
  color: #fff;
  border-color: rgba(255, 170, 160, 0.28);
}

.detail-edit-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Grid rather than flex: minmax(0, 1fr) forces the datetime column to give
   way to the button no matter how wide iOS Safari decides the native
   datetime-local control "wants" to be (its intrinsic width was overflowing
   the flex version and rendering underneath the button on real devices). */
.datetime-location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.datetime-location-field {
  min-width: 0;
  overflow: hidden;
}

.datetime-location-field input {
  /* Font-size stays at the 16px .field input default - anything smaller
     makes iOS Safari auto-zoom the page when this field is focused. */
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 6px;
  -webkit-appearance: none;
  appearance: none;
}

.datetime-location-field input::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.2em;
}

.datetime-location-button {
  white-space: nowrap;
  padding: 10px 12px;
  font-size: 0.72rem;
}

.datetime-location-button.hidden {
  display: none;
}

.detail-edit-form.hidden {
  display: none;
}

.leaflet-container {
  font: inherit;
}

@media (min-width: 500px) {
  body {
    padding: 16px 0 24px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 1.55rem;
  }

  .topbar-actions {
    gap: 4px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .google-button {
    padding: 7px 8px;
    gap: 5px;
    font-size: 0.72rem;
  }

  .google-mark {
    width: 20px;
    height: 20px;
  }
}
