:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #202521;
  --muted: #657069;
  --line: #ddd9ce;
  --accent: #0f6e56;
  --accent-soft: #e0f3ed;
  --warn: #8f3d1f;
  --warn-soft: #faebe5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
}

input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.app-header {
  padding: 16px 0 20px;
}

.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 32px;
}

h2 {
  font-size: 18px;
}

.summary,
.panel p,
.meta,
.attribution {
  color: var(--muted);
}

.panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.auth-row,
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.search-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
}

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

.status-panel.warn {
  border-color: #edb49f;
  background: var(--warn-soft);
  color: var(--warn);
}

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

.recommendation {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.rec-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.rank {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.rec-title {
  margin: 2px 0 4px;
  font-size: 18px;
}

.meta {
  margin-bottom: 12px;
}

.details {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.detail-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

.detail-row dt,
.detail-row dd {
  margin: 0;
}

.detail-row dt {
  color: var(--ink);
  font-weight: 700;
}

.reason-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.reason {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 9px;
  font-size: 13px;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  text-decoration: none;
}

.coords {
  color: var(--muted);
  font-size: 13px;
}

.suggestions {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.suggestion {
  width: 100%;
  min-height: 48px;
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion small {
  display: block;
  color: var(--muted);
}

.link-button {
  background: transparent;
  color: var(--accent);
  padding: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 420px) {
  .auth-row,
  .search-row {
    grid-template-columns: 1fr;
  }
}
