* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: #1f2733;
}
#app {
  display: flex;
  height: 100%;
}
#map {
  flex: 1;
  min-width: 0;
}
#panel {
  width: 400px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 16px;
  background: #fafbfc;
  border-left: 1px solid #dde3ea;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
h1 {
  font-size: 18px;
  margin: 0;
}
.sub {
  font-size: 12px;
  color: #5b6675;
  margin: 0;
}
section {
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 12px;
}
section h2 {
  font-size: 13px;
  margin: 0 0 8px;
  color: #39434f;
}
label {
  display: block;
  font-size: 12px;
  margin: 8px 0 2px;
  color: #4a5462;
}
input[type="range"] {
  width: 100%;
}
input[type="text"],
select,
textarea {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #c9d2dc;
  border-radius: 6px;
  font-family: inherit;
}
textarea {
  font-family: ui-monospace, Menlo, monospace;
  resize: none;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row > * {
  flex: 1;
}
.row > button {
  flex: 0 0 auto;
}
button {
  padding: 7px 14px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  background: #2f6fde;
  color: #fff;
  cursor: pointer;
}
button:hover {
  background: #2558b8;
}
button:disabled {
  background: #9db4d8;
  cursor: wait;
}
button.secondary {
  background: #eef2f7;
  color: #2f3b4a;
}
button.secondary:hover {
  background: #dfe6ee;
}
.big {
  width: 100%;
  padding: 10px;
  font-size: 14px;
}
#preview {
  width: 100%;
  height: 260px;
  border-radius: 6px;
  overflow: hidden;
  background: #e8ecef;
}
#status {
  font-size: 12px;
  color: #3f6f3f;
  min-height: 1.5em;
}
#status.error {
  color: #b3261e;
}
.meta {
  font-size: 12px;
  color: #5b6675;
}
.warn {
  color: #8a5a00;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4a5462;
  margin: 8px 0 2px;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
}
.tier-group {
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 8px 10px 4px;
  margin: 0 0 8px;
}
.tier-group legend {
  font-size: 11.5px;
  color: #5b6675;
  padding: 0 4px;
}
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: #2f3b4a;
  margin: 4px 0;
  cursor: pointer;
}
.radio-row input[type="radio"] {
  width: auto;
  margin-top: 2px;
  flex-shrink: 0;
}
.radio-row small {
  display: block;
  font-size: 11px;
  color: #6b7686;
  margin-top: 1px;
}
.legend-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4a5462;
  margin: 6px 0 2px;
}
.legend-swatch {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: rgba(58, 167, 109, 0.12);
  border: 1px solid rgba(58, 167, 109, 0.5);
  flex-shrink: 0;
}
.help-btn {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #c9d2dc;
  background: #eef2f7;
  color: #4a5462;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.help-btn:hover {
  background: #dfe6ee;
}
.help-btn[aria-expanded="true"] {
  background: #2f6fde;
  border-color: #2f6fde;
  color: #fff;
}
.popover {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  margin-top: 6px;
  width: 260px;
  max-width: 80vw;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #39434f;
  box-shadow: 0 4px 16px rgba(20, 30, 50, 0.14);
}
.popover p {
  margin: 0;
}
.popover[hidden] {
  display: none;
}
.note {
  font-size: 11px;
  color: #6b7686;
  line-height: 1.6;
}
.preview-summary {
  margin: 0;
  padding-left: 18px;
}
.preview-summary li + li {
  margin-top: 4px;
}
.link-btn {
  background: none;
  border: none;
  padding: 4px 0 0;
  font-size: 11px;
  color: #2f6fde;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover {
  background: none;
  color: #2558b8;
}
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pyt-spin 0.7s linear infinite;
}
.spinner[hidden] {
  display: none;
}
@keyframes pyt-spin {
  to {
    transform: rotate(360deg);
  }
}
dialog#previewDialog {
  max-width: 460px;
  width: 90vw;
  border: none;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 12px 40px rgba(20, 30, 50, 0.25);
}
dialog#previewDialog::backdrop {
  background: rgba(20, 26, 36, 0.45);
}
dialog#previewDialog h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #1f2733;
}
dialog#previewDialog .secondary {
  margin-top: 10px;
}
ul.notice {
  margin: 0;
  padding-left: 18px;
  font-size: 11.5px;
  color: #4a5462;
  line-height: 1.7;
}
ul.notice li + li {
  margin-top: 6px;
}
details summary {
  cursor: pointer;
  font-size: 13px;
  color: #39434f;
}
footer {
  font-size: 10.5px;
  color: #7a8494;
  line-height: 1.6;
}
footer a {
  color: inherit;
}
@media (max-width: 860px) {
  #app {
    flex-direction: column;
  }
  #map {
    height: 46vh;
    flex: none;
  }
  #panel {
    width: 100%;
    flex: 1;
    border-left: none;
    border-top: 1px solid #dde3ea;
  }
}
