* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { display: flex; flex-direction: column; overflow: hidden; }

#filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
#filters .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.chip {
  padding: 10px 16px;
  border: 2px solid var(--op-color, #ddd);
  background: #f5f5f5;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
  color: #222;
  font-family: inherit;
}
.chip.active { background: var(--op-color, #222); color: #000; border-color: #222; }
.chip[data-op="ionity"].active { background: #fff; color: #222; }
.chip[data-op="enbw"].active { color: #222; }
.chip[data-op="ewe"].active { color: #fff; }

.kw-chip {
  padding: 8px 14px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
  cursor: pointer;
  color: #444;
  font-family: inherit;
}
.kw-chip.active { background: #222; color: #fff; border-color: #222; }

#geo-btn {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: none;
  background: #f5f5f5;
  border-radius: 22px;
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
}

#map { flex: 1; z-index: 1; }

#list-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  padding: 12px 20px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  z-index: 1001;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: inherit;
}

#feedback-toggle {
  position: fixed;
  bottom: 16px;
  left: 16px;
  padding: 12px 16px;
  background: #fff;
  color: #222;
  border: 2px solid #222;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1001;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: inherit;
}

#feedback-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
  z-index: 1003;
  max-height: 90vh;
  overflow-y: auto;
}
#feedback-modal h2 { font-size: 20px; margin-bottom: 8px; padding-right: 40px; }
#feedback-modal .hint { color: #666; font-size: 14px; margin-bottom: 16px; }
#feedback-modal .req { color: #c62828; }
#feedback-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  background: #eee;
  border-radius: 18px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
#feedback-form label {
  display: block;
  margin-bottom: 14px;
}
#feedback-form label > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}
#feedback-form select,
#feedback-form input[type="text"],
#feedback-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: #222;
  min-height: 44px;
}
#feedback-form textarea { resize: vertical; min-height: 72px; }
#feedback-form .btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  cursor: pointer;
  font-size: 16px;
}
#feedback-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}
#feedback-result.ok    { background: #e8f5e9; color: #1b5e20; }
#feedback-result.error { background: #ffebee; color: #b71c1c; }

#sheet .btn-feedback {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
  background: #fff;
  color: #222;
  border: 1px solid #c62828;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  min-height: 44px;
}

#list, #sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
  z-index: 1002;
  max-height: 75vh;
  overflow-y: auto;
}

#list h2 { font-size: 18px; margin-bottom: 12px; }
#list ol { list-style: none; }
#list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  min-height: 44px;
}
#list li.hint { color: #666; font-size: 14px; cursor: default; }
#list li .dot {
  width: 12px;
  height: 12px;
  border-radius: 6px;
  border: 1px solid #222;
  flex-shrink: 0;
}

#sheet h3 { margin-bottom: 8px; font-size: 22px; padding-right: 40px; }
#sheet h3::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 7px;
  background: var(--op-color, #888);
  border: 1px solid #222;
  margin-right: 8px;
  vertical-align: middle;
}
#sheet p { margin: 6px 0; font-size: 15px; line-height: 1.4; }
#sheet .addr { color: #444; }
#sheet .dist { color: #1976d2; font-weight: 600; }
#sheet .price { font-size: 18px; font-weight: 600; color: #222; margin-top: 12px; }
#sheet small { color: #888; font-weight: 400; font-size: 12px; }

#sheet-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  background: #eee;
  border-radius: 18px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.live-status {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 14px;
  line-height: 1.4;
}
.live-status .ls-free   { color: #1b7d1b; }
.live-status .ls-busy   { color: #c62828; }
.live-status .ls-unknown{ color: #666; }
.live-status small { color: #888; font-size: 11px; margin-left: 4px; }

.btn-primary, .btn-secondary {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 8px;
  min-height: 44px;
  line-height: 20px;
  font-size: 15px;
}
.btn-primary { background: #222; color: #fff; }
.btn-secondary { background: #f5f5f5; color: #222; border: 1px solid #ddd; }

#list-close {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  min-height: 44px;
  font-family: inherit;
}

#status {
  position: fixed;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 13px;
  z-index: 999;
  pointer-events: none;
  max-width: 90%;
}
#status:empty { display: none; }

@media (min-width: 600px) {
  #list, #sheet { left: auto; right: 16px; bottom: 16px; max-width: 380px; border-radius: 16px; }
}
