:root {
  --surface: #f9f9f9;
  --surface-white: #ffffff;
  --surface-low: #f3f3f3;
  --surface-container: #eeeeee;
  --surface-high: #e8e8e8;
  --text: #1a1c1c;
  --muted: #666666;
  --primary: #002442;
  --primary-container: #1a3a5a;
  --green: #2d5a27;
  --border: #e5e5e5;
  --outline: #73777e;
  --outline-light: #c3c6ce;
  --danger: #ba1a1a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--surface);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Future map elements allow full touch operations */
.map-container,
[data-allow-zoom="true"] {
  touch-action: auto !important;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  line-height: 1;
}

.app-shell {
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(56px + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(249, 249, 249, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand,
.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  min-width: 0;
}

.brand h1,
.title-row h1 {
  margin: 0;
  font-size: 22px;
  line-height: 30px;
  font-weight: 700;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--primary);
}

.icon-button:active,
.bottom-tab:active,
.soft-button:active,
.primary-button:active {
  transform: scale(0.97);
}

.place-status {
  min-height: 60px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(249, 249, 249, 0.92);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(45, 90, 39, 0.08);
  flex: 0 0 auto;
}

.status-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.view {
  padding: 24px 16px 104px;
}

.list-card,
.places-card,
.form-card,
.empty-card {
  background: var(--surface-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.list-row {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 28px;
  background: var(--surface-white);
  border-bottom: 1px solid var(--border);
  transition: background 160ms ease;
}

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

.list-row:active {
  background: var(--surface-low);
}

.check {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  border: 3px solid var(--outline-light);
  background: var(--surface-white);
  color: var(--surface-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.check.done {
  border-color: var(--green);
  background: var(--green);
}

.task-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 21px;
  line-height: 1.45;
  word-break: break-word;
}

.task-text.done {
  color: var(--muted);
  text-decoration: line-through;
}

.task-delete {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #8e9196);
  background: transparent;
  flex-shrink: 0;
  transition: color 150ms ease, background 150ms ease;
}

.task-delete:hover,
.task-delete:focus-visible {
  color: #d93025;
  background: rgba(217, 48, 37, 0.08);
}

.task-delete:active {
  background: rgba(217, 48, 37, 0.16);
}

.center-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.soft-button,
.ghost-button,
.primary-button {
  min-height: 48px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  font-weight: 700;
  transition: transform 120ms ease, background 120ms ease;
}

.soft-button {
  border: 1px solid var(--border);
  background: var(--surface-white);
  color: var(--primary-container);
  border-radius: 999px;
}

.ghost-button {
  border: 1px solid var(--primary-container);
  background: transparent;
  color: var(--primary-container);
}

.primary-button {
  width: 100%;
  background: var(--primary-container);
  color: #fff;
  min-height: 56px;
}

.fab {
  position: fixed;
  right: max(16px, calc((100vw - 720px) / 2 + 16px));
  bottom: calc(76px + var(--safe-bottom));
  z-index: 30;
  height: 64px;
  border-radius: 999px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--primary-container);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 36, 66, 0.18);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(720px, 100vw);
  transform: translateX(-50%);
  height: calc(72px + var(--safe-bottom));
  padding: 0 20px var(--safe-bottom);
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  color: #3f4348;
  font-size: 13px;
  font-weight: 700;
}

.bottom-tab.active {
  color: var(--primary);
}

.toolbar-action {
  color: #3f4348;
}

.places-add {
  margin-bottom: 28px;
}

.place-row {
  min-height: 104px;
  width: 100%;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 16px;
  background: var(--surface-white);
  color: var(--text);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.place-row:last-child {
  border-bottom: 0;
}

.place-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--surface-low);
  flex: 0 0 auto;
}

.place-name {
  display: block;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.place-kind {
  display: block;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.place-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--primary-container);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.badge.green {
  background: var(--green);
}

.badge.empty {
  background: var(--surface-container);
  color: #555;
}

.distance {
  color: var(--muted);
  font-size: 15px;
}

.add-screen .topbar {
  justify-content: center;
}

.header-side {
  position: absolute;
  left: 16px;
  color: var(--primary);
  background: transparent;
  font-size: 16px;
  font-weight: 500;
}

.add-options {
  display: grid;
  gap: 16px;
}

.option-row {
  width: 100%;
  min-height: 100px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-white);
  color: var(--text);
  text-align: left;
  font-size: 21px;
}

.map-image {
  margin: 24px 0 28px;
  height: 276px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2)),
    url("https://lh3.googleusercontent.com/aida-public/AB6AXuBKJIaqPSqJkbw8n91yz40RobZ4te6dqxiX9y30yXk3VBL3hnxZrFrpiBy30HnEmC6JsBMkl1F5Iwf59OFlxQMWTJCMJvpaIecL_E4GG5_P_-SaYOTx4SLmc9FD4JpT9wEZ899W9_1Q6ViBWSRvzJ-KQ2sCeqT4xxF1eZom0NWKAFZufJIfsDkfb6eTenSjVzVrDGPKNZkO3WrLrcrS3keaL1g8b0o-_nHoJIfructt_vYJmbQzSMyxauMgH9LGaThPFjUv9E4gwfQ9") center / cover;
}

.map-pin {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  color: var(--primary);
  font-size: 52px;
  text-shadow: 0 3px 8px rgba(0, 36, 66, 0.18);
}

.map-label {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-weight: 700;
}

.form-card {
  padding: 28px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.field label,
.range-head {
  color: #43474e;
  font-size: 15px;
  font-weight: 500;
}

.input,
.select {
  width: 100%;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 18px;
  font-size: 20px;
}

.input::placeholder {
  color: #b9bec8;
}

.range-block {
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

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

.radius-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.radius-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radius-options label {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 23px;
}

.radius-options input:checked + label {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.helper {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.privacy-note {
  margin: 48px 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
  padding: 24px 0 40px;
  position: relative;
  overflow: hidden;
}

.empty-state::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -110px;
  bottom: 52px;
  border-radius: 50%;
  background: rgba(171, 201, 240, 0.4);
  filter: blur(58px);
  z-index: 0;
}

.empty-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
  width: 100%;
}

.empty-icon {
  width: 108px;
  height: 108px;
  border-radius: 999px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #496b8f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.empty-icon .material-symbols-outlined {
  font-size: 48px;
}

.empty-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.55;
  font-weight: 500;
}

.empty-copy {
  margin: 0 auto;
  max-width: 330px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.8;
}

.empty-actions {
  display: grid;
  gap: 16px;
}

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

.settings-block {
  padding: 18px;
}

.settings-block h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.settings-block p {
  margin: 0;
  color: var(--muted);
}

.search-box {
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 60;
  min-width: min(320px, calc(100vw - 32px));
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  background: #2f3131;
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.hidden {
  display: none !important;
}

@media (max-width: 520px) {
  .task-text {
    font-size: 21px;
  }

  .list-row {
    padding: 16px 24px;
  }

  .place-row {
    grid-template-columns: 50px minmax(0, 1fr) auto 16px;
    gap: 10px;
    padding: 0 20px;
  }

  .place-name {
    font-size: 20px;
  }

  .place-kind,
  .distance {
    font-size: 15px;
  }

  .fab {
    right: 28px;
    bottom: calc(88px + var(--safe-bottom));
  }
}

@media (min-width: 721px) {
  .topbar,
  .place-status {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: min(560px, 100vw);
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
  z-index: 101;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.modal.active {
  transform: translate(-50%, 0);
}

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

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #1c1d1f);
}

.modal-form .field {
  margin-bottom: 24px;
}

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

.modal-body {
  margin-bottom: 24px;
}

.modal-message {
  margin: 0;
  color: var(--muted, #5f6368);
  font-size: 16px;
  line-height: 1.6;
}

.danger-button {
  height: 56px;
  border-radius: 12px;
  border: none;
  background: #d93025;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.danger-button:hover {
  background: #b22a1d;
}

/* Apps Shortcut Section */
.apps-section {
  margin-bottom: 20px;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
}

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

.apps-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.add-app-btn {
  background: transparent;
  border: none;
  color: var(--primary-container, #005ac1);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.apps-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.app-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-low, #f2f4f8);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  gap: 12px;
}

.app-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-container, #005ac1);
}

.app-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.app-open-button {
  background: var(--primary-container, #005ac1);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s ease;
}

.app-open-button .material-symbols-outlined {
  font-size: 16px;
}

.app-open-button:active {
  opacity: 0.85;
}

.app-delete-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.app-delete-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* App Preset Modal */
.preset-section {
  margin-bottom: 16px;
}

.preset-label {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  background: var(--surface-low, #f2f4f8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s ease;
}

.preset-btn:hover {
  background: #e6e9f0;
}

.modal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.modal-divider::before,
.modal-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.modal-divider span {
  padding: 0 10px;
}

.field-helper {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}




