* { box-sizing: border-box; }
[hidden] { display: none !important; } /* author display rules must not defeat hidden */
html, body { height: 100%; margin: 0; font-family: system-ui, sans-serif; }
body { display: flex; }

#sidebar {
  width: 300px;
  min-width: 300px;
  padding: 16px;
  overflow-y: auto;
  background: #f7f7f9;
  border-right: 1px solid #ddd;
}
#map { flex: 1; }

h1 { margin: 0 0 4px; font-size: 22px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #666; margin: 0 0 8px; }
section { margin: 18px 0; padding: 12px; background: #fff; border: 1px solid #e3e3e6; border-radius: 8px; }
label { display: block; margin: 6px 0; font-size: 14px; }
label.chk, section > label input[type=radio] { display: inline-block; }
.row { display: flex; gap: 12px; align-items: center; }
input[type=number] { width: 70px; }
select { width: 100%; }

button, .button, .filebtn {
  display: block; width: 100%; margin: 6px 0; padding: 8px 10px;
  font-size: 14px; text-align: center; text-decoration: none;
  border: 1px solid #bbb; border-radius: 6px; background: #fff; color: #222;
  cursor: pointer;
}
button:hover, .button:hover, .filebtn:hover { background: #f0f0f4; }
button.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
button.primary:hover { background: #1d4ed8; }
button.active { outline: 2px solid #2563eb; }
button:disabled { opacity: .5; cursor: default; }
.filebtn input { display: none; }
button.mini { width: 34px; flex: 0 0 34px; padding: 8px 0; }

.status { font-size: 13px; margin-top: 6px; color: #444; min-height: 1em; }
.status.err { color: #b91c1c; }
.status.selectable { user-select: all; word-break: break-all; }

#auth-bar { font-size: 13px; color: #444; margin-bottom: 4px; }
#auth-bar a { color: #2563eb; }

#login-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(247, 247, 249, 0.96);
}
.login-box {
  width: 320px; padding: 28px; text-align: center;
  background: #fff; border: 1px solid #e3e3e6; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.login-box .button { background: #fc4c02; border-color: #fc4c02; color: #fff; }
.login-box .button:hover { background: #e34402; }
.hint { font-size: 12px; color: #888; }
#stats { font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
#stats b { font-size: 16px; }
