:root {
  --blood-red: #d9232e;
  --deep-red: #6e1016;
  --soft-red: #fff0f0;
  --warm-bg: #fafafa;
  --text: #181818;
  --muted: #666;
  --line: #ececec;
  --card: #fff;
  --shadow: 0 3px 12px rgba(110, 16, 22, .08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--warm-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--warm-bg);
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--warm-bg);
  position: relative;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: calc(58px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 8px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--blood-red);
  font-size: 28px;
  line-height: 1;
}

.top-bar h1 {
  margin: 0;
  color: var(--deep-red);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.view {
  min-height: calc(100dvh - 136px);
  padding: 16px 16px calc(92px + env(safe-area-inset-bottom));
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 480px);
  transform: translateX(-50%);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 2px;
  cursor: pointer;
}

.nav-item span:first-child {
  font-size: 22px;
  line-height: 1;
}

.nav-item span:last-child {
  font-size: 12px;
  font-weight: 700;
}

.nav-item.is-active {
  color: var(--blood-red);
  background: var(--soft-red);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 800;
}

.section-title .icon {
  color: var(--blood-red);
  font-size: 28px;
}

.stack {
  display: grid;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 16px;
}

.soft-card {
  background: var(--soft-red);
  border-color: #ffd8d8;
}

.location-summary,
.notice-row,
.reminder-entry,
.setting-row,
.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-summary {
  justify-content: space-between;
}

.summary-text {
  min-width: 0;
}

.label {
  color: var(--muted);
  font-size: 14px;
}

.selected-area {
  color: var(--blood-red);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button-row {
  display: flex;
  gap: 8px;
}

.button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid var(--blood-red);
  font-weight: 800;
  cursor: pointer;
}

.button {
  background: var(--blood-red);
  color: #fff;
}

.ghost-button {
  background: #fff;
  color: var(--deep-red);
}

.full {
  width: 100%;
}

.muted {
  color: var(--muted);
}

.strong-red {
  color: var(--deep-red);
  font-weight: 800;
}

.county-list {
  max-height: 320px;
  overflow: auto;
  padding: 8px;
}

.county-list button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--deep-red);
  text-align: left;
  font-weight: 700;
  padding: 0 12px;
}

.county-list button:active {
  background: var(--soft-red);
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chip {
  min-height: 36px;
  border: 1px solid #d6d6d6;
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.is-active {
  border-color: var(--blood-red);
  background: var(--soft-red);
  color: var(--deep-red);
}

.group-title {
  margin: 6px 4px 0;
  color: var(--deep-red);
  font-size: 15px;
  font-weight: 800;
}

.location-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding: 14px;
}

.location-art {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 999px;
  color: var(--blood-red);
  font-size: 33px;
  background: radial-gradient(circle, #ffd9d9, #fff);
}

.location-art.mobile {
  background: radial-gradient(circle, #ddf3ff, #fff);
}

.location-body {
  min-width: 0;
}

.location-name {
  margin: 0 0 7px;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 800;
}

.assist-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 15px;
  padding: 0 10px;
  background: #f7f7f7;
  color: var(--deep-red);
  font-size: 13px;
  font-weight: 800;
}

.meta-row {
  align-items: flex-start;
  margin-top: 6px;
  font-size: 14px;
}

.meta-row .meta-icon {
  flex: 0 0 auto;
  width: 18px;
}

.card-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

.waiting {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.waiting strong {
  display: block;
  color: var(--blood-red);
  font-size: 29px;
  line-height: 1.1;
}

.notice-row {
  color: var(--blood-red);
  font-weight: 800;
}

.notice-row .big-icon {
  font-size: 38px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.field input {
  min-height: 48px;
  width: 100%;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.setting-row {
  width: 100%;
  min-height: 58px;
  border: 0;
  justify-content: space-between;
  background: #fff;
  color: var(--text);
  padding: 0 16px;
  text-align: left;
  font-weight: 800;
}

.setting-row .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-link {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 4px 0 8px;
}

.footer-link a {
  color: var(--blood-red);
  font-weight: 800;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 8;
  width: min(92vw, 420px);
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(24, 24, 24, .92);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 360px) {
  .location-card {
    grid-template-columns: 1fr;
  }

  .location-art {
    width: 58px;
    height: 58px;
    font-size: 28px;
  }

  .button-row {
    flex-direction: column;
  }
}
