:root {
  --ink: #1c1914;
  --paper: rgba(247, 243, 234, 0.94);
  --line: #d9cfc0;
  --copper: #8d4b24;
  --sea: #1e3d42;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
  color: var(--ink);
  background: #1b2428;
}

#view { position: fixed; inset: 0; display: block; }

header, #north, aside, footer {
  position: fixed;
  z-index: 2;
}

header {
  top: 18px;
  left: 22px;
  max-width: min(440px, 36vw);
  color: #f6f1e7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  font-size: 11px;
}

h1 {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lead { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }

#north {
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 28, 32, 0.45);
  color: #f4efe4;
  display: grid;
  place-items: center;
}

#north b {
  display: block;
  font-size: 14px;
  transform-origin: 50% 50%;
}

aside {
  top: 16px;
  right: 16px;
  bottom: 42px;
  width: min(360px, calc(100vw - 24px));
  overflow: auto;
  padding: 16px 16px 20px;
  background: var(--paper);
  border: 1px solid #efe6d6;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

label, legend { font-size: 12px; letter-spacing: 0.04em; }

.row { display: flex; gap: 8px; margin-top: 6px; }

input[type="text"], input[type="password"], input:not([type]) {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--sea);
  color: #f7f3ea;
  font: inherit;
  padding: 8px 12px;
  cursor: pointer;
}

button:hover { background: #27555b; }

#hits { list-style: none; margin: 8px 0 0; padding: 0; }
#hits li { margin: 0; }
#hits button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 2px;
}
#hits button:hover { background: #efe6d4; }

#leaflet {
  height: 210px;
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.place {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.actions, .export-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.actions button, #gmaps { background: #efe6d4; color: var(--ink); }
.actions button:hover, #gmaps:hover { background: #e4d7be; }

fieldset {
  margin: 14px 0 0;
  padding: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

fieldset label { display: block; margin: 4px 0; font-size: 13px; letter-spacing: 0; }
#reload { margin-top: 8px; background: #efe6d4; color: var(--ink); }
#reload:hover { background: #e4d7be; }

.slider { display: block; margin-top: 12px; font-size: 13px; }
.slider input { width: 100%; margin-top: 4px; }
.check { display: block; margin-top: 8px; font-size: 13px; }

.key-row { margin-top: 8px; }
.hint, #status {
  color: #5e564c;
  font-size: 12px;
  line-height: 1.5;
}

#panels { margin-top: 12px; display: grid; gap: 12px; }
.card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.card header {
  position: static;
  color: var(--ink);
  text-shadow: none;
  padding: 8px 10px 0;
  max-width: none;
}
.card h2 { margin: 0; font-size: 15px; }
.card p { margin: 2px 0 8px; font-size: 12px; color: #5c564c; }
.card img {
  display: block;
  width: 100%;
  background-color: #d5ddd8;
  background-image:
    linear-gradient(45deg, #c5d0cb 25%, transparent 25%),
    linear-gradient(-45deg, #c5d0cb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c5d0cb 75%),
    linear-gradient(-45deg, transparent 75%, #c5d0cb 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}
.card a { color: var(--copper); }

footer {
  left: 18px;
  right: 390px;
  bottom: 8px;
  color: #efe8dc;
  font-size: 11px;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

footer a { color: #f3d7b0; }
footer span { display: block; }

@media (max-width: 860px) {
  header { display: none; }
  aside { top: auto; bottom: 36px; max-height: 48vh; }
  footer { right: 12px; }
}
