:root {
  --bg: #fafafa;
  --fg: #222;
  --muted: #666;
  --border: #ddd;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --highlight: #fff3b0;
}

* { box-sizing: border-box; }

body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif;
}

main {
  max-width: 680px;
  margin: 2rem auto;
  padding: 1.5rem 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

h1 { margin-top: 0; font-size: 1.4rem; }
h2 { font-size: 1.05rem; margin-top: 1.5rem; }
.lead { color: var(--muted); margin-top: -0.5rem; }

form label {
  display: block;
  margin: 1rem 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

input[type=text], input[type=date], input[type=time], input[type=number], select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
}

input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}
.row label { margin-top: 1rem; }
@media (max-width: 500px) { .row { grid-template-columns: 1fr; } }

small { color: var(--muted); font-size: 0.8rem; }

.place-field { position: relative; }

#place-suggest {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 10;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#place-suggest li {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
#place-suggest li:first-child { border-top: none; }
#place-suggest li:hover,
#place-suggest li.active {
  background: var(--highlight);
}
#place-suggest .main { font-weight: 600; }
#place-suggest .meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.resolved {
  margin-top: 1rem;
  background: #f1f8ff;
  border: 1px solid #cde;
  border-radius: 6px;
  padding: 0.75rem 1rem;
}
.resolved dl { margin: 0; display: grid; grid-template-columns: 7rem 1fr; gap: 0.25rem 1rem; }
.resolved dt { color: var(--muted); font-size: 0.85rem; }
.resolved dd { margin: 0; }

button {
  margin-top: 1.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { background: var(--accent-hover); }

pre {
  background: #1f2430; color: #e0e6f0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font: 0.85rem/1.5 "SF Mono", Menlo, monospace;
}

hr { margin: 2rem 0 1rem; border: none; border-top: 1px solid var(--border); }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }

#reverse-result { margin-top: 1rem; font-size: 0.9rem; }
