@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&display=swap');

:root {
  /* Dark mode */
  --col-darkest: #111;
  --col-darker: #181818;
  --col-dark: #333;
  --col-light: #888;
  --col-lighter: #ccc;
  --col-lightest: #eee;
  --col-white-faded: rgba(255, 255, 255, 0.5);

  /* Light mode */
  /* --col-lightest: #111;
  --col-lighter: #222;
  --col-light: #333;
  --col-dark: #aaa;
  --col-darker: #ddd;
  --col-darkest: #eee;
  --col-white-faded: rgba(255, 255, 255, 0.5); */

  --col-pastel-blue: #68b3e8;
  --col-pastel-green: #66bb6b;
  --col-pastel-purple: #a066bb;
  --col-pastel-red: #e65c46;

  --col-lines: var(--col-lighter);
  --col-innerlines: var(--col-lighter);
  --col-circles: var(--col-lightest);

  --opacity-dynmap: 0.7;      /* the base map image */
  --opacity-polygons: 0.5;    /* political region fills */
  --opacity-polygons-hover: 0.5;
  --opacity-faded: 0.5;       /* the base layer, while another layer is shown */
  --opacity-dynmap-faded: 0.35; /* the base map image, then too */

  --line-width: 0.12rem;
  --box-shadow: 0.3rem 0.3rem 1.3rem rgba(0, 0, 0, 0.2);
  --box-shadow-dark: 0.3rem 0.3rem 1.3rem rgba(0, 0, 0, 0.4);

  --font-serif: "Fraunces", serif;
  --font-sans: "Roboto", sans-serif;
  --font-mono: "Roboto Mono", monospace;
}

html {
  background: var(--col-lightest);
  font-size: 15px;
}

body {
  background: var(--col-darkest);
  font-family: var(--font-sans);
  font-size: 1rem;
  margin: 0;
  height: 100vh;
  display: flex;
  overflow: hidden;
  line-height: 1.5rem;
}

a {
  text-decoration: none;
  color: inherit;
}

#map {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 7;
}

#sidebar {
  z-index: 8;

  background: var(--col-darker);
  color: var(--col-lightest);
  box-shadow: var(--box-shadow);
  height: 100vh;
  overflow: scroll;
  width: 27.5rem;
}

.clear svg {
  width: 1.5rem;
  margin-left: -2.3rem;
  stroke: var(--col-light);
  fill: var(--col-dark);
  stroke-width: 0.2rem;
  position: relative;
  top: 7px;
}

.top {
  padding: 3rem 1.5rem 0.75rem 1.5rem;
}

.title {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 1rem;
}

.info, .subtitle {
  text-align: center;
  color: var(--col-light);
  font-weight: 500;
  font-style: italic;
  margin-bottom: 1.75rem;
  line-height: 1.75rem;
}

.subtitle {
  font-size: 1.2rem;
}

.tiny {
  text-align: center;
  color: var(--col-light);
  font-size: 0.8rem;
  margin: 1rem 0;
}

.info a {
  color: var(--col-lightest);
}

.info a:hover {
  color: var(--col-lighter);
}

.searchbox {
  text-align: center;
  margin-bottom: 0.75rem;
}

/* Only on phones (see the end) */
.directory-toggle,
.account-toggle,
.crosshair,
.account .no-editing {
  display: none;
}

.search {
  font-family: var(--font-mono);
  color: var(--col-lightest);
  background: var(--col-dark);
  border: 0.1rem solid var(--col-dark);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  width: 80%;
}

/* Account */

/* The account box and the editor panel, stacked over the map, top right */
.corner {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  max-height: calc(100vh - 2rem);
  max-width: calc(100vw - 2rem);
}

.account {
  max-width: 22rem;
  padding: 0.6rem 1rem;
  background: var(--col-darker);
  border-radius: 0.3rem;
  box-shadow: var(--box-shadow);
  text-align: center;
  color: var(--col-light);
  font-size: 0.9rem;
}

.account:empty {
  display: none;
}

.account strong,
.account .link {
  color: var(--col-lightest);
}

.account .link {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.account .link:hover {
  color: var(--col-lighter);
}

.account .row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.5rem 0;
}

.account input,
.account button:not(.link) {
  font: inherit;
  color: var(--col-lightest);
  background: var(--col-dark);
  border: 0.1rem solid var(--col-dark);
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
}

.account .stack {
  flex-direction: column;
}

.account input {
  flex: 1;
  min-width: 0;
}

.account button:not(.link) {
  white-space: nowrap;
  cursor: pointer;
  border-color: var(--col-light);
}

.account .error {
  color: var(--col-pastel-red);
}

.account .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: center;
  margin-top: 0.25rem;
}

/* Links wrap onto a new row whole, rather than breaking mid-label. */
.account .links > * {
  white-space: nowrap;
}

/* Editor panel, below the account box */

.panel {
  width: 24rem;
  max-width: 100%;
  min-height: 0;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 0.75rem 1rem 1rem;
  background: var(--col-darker);
  color: var(--col-lighter);
  border-radius: 0.3rem;
  box-shadow: var(--box-shadow);
  font-size: 0.9rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.panel h2 {
  font-size: 1.1rem;
  color: var(--col-lightest);
  margin: 0 0 0.5rem;
}

.panel p {
  margin: 0.5rem 0;
}

.panel .muted {
  color: var(--col-light);
}

.panel input:not([type=checkbox]):not([type=color]),
.panel select,
.panel textarea,
.panel button:not(.link) {
  font: inherit;
  color: var(--col-lightest);
  background: var(--col-dark);
  border: 0.1rem solid var(--col-dark);
  border-radius: 0.4rem;
  padding: 0.35rem 0.6rem;
  box-sizing: border-box;
}

.panel input[type=search],
.panel textarea,
.panel .field input {
  width: 100%;
}

.panel input[type=color] {
  width: 2.5rem;
  padding: 0;
  border: none;
  background: none;
}

.panel textarea {
  min-height: 4rem;
  margin-top: 0.5rem;
}

.panel button {
  cursor: pointer;
}

.panel button:not(.link) {
  border-color: var(--col-light);
}

.panel button.primary {
  background: var(--col-pastel-green);
  border-color: var(--col-pastel-green);
  color: var(--col-darkest);
  font-weight: 500;
}

.panel .link {
  font: inherit;
  color: var(--col-lightest);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}

.panel .close {
  font-size: 1.4rem;
  text-decoration: none;
}

.panel .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.panel .field {
  display: block;
  margin: 0.5rem 0;
}

.panel .field > span {
  display: block;
  color: var(--col-light);
  font-size: 0.8rem;
}

.panel .help {
  display: block;
  margin: -0.1rem 0 0.3rem;
  color: var(--col-light);
  font-size: 0.65rem;
  line-height: 1.2;
}

.panel .check .help {
  margin-left: 1.5rem;
}

.panel .field .row {
  margin: 0;
  flex-wrap: nowrap;
}

.panel .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.panel .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.35rem 0.3rem 0.7rem;
  background: var(--col-dark);
  border: 1px solid var(--col-light);
  border-radius: 0.4rem;
}

.panel .chip .link {
  padding: 0 0.3rem;
  border-radius: 0.25rem;
  text-decoration: none;
  color: var(--col-light);
}

.panel .chip .link:hover {
  color: var(--col-lightest);
  background: var(--col-darker);
}

.panel .check {
  display: block;
  margin: 0.5rem 0;
}

.panel .results {
  display: flex;
  flex-direction: column;
  margin: 0.25rem 0 0.5rem;
}

.panel button.result,
.panel button.request {
  text-align: left;
  border: none;
  background: none;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
}

.panel button.result:hover,
.panel button.request:hover {
  background: var(--col-dark);
}

.panel button.request {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 1rem;
}

.panel .status {
  color: var(--col-light);
  white-space: nowrap;
}

.panel .status.approved { color: var(--col-pastel-green); }
.panel .status.rejected,
.panel .status.stale { color: var(--col-pastel-red); }
.panel .status.submitted { color: var(--col-pastel-blue); }

.panel .shape {
  margin: 0.75rem 0;
}

.panel .change {
  margin: 0.75rem 0;
}

.panel .change-title {
  font-weight: 500;
  color: var(--col-lightest);
}

.panel .op {
  margin: 0.25rem 0;
  flex-wrap: nowrap;
}

.panel .op .change-title {
  flex: 1;
}

.change-title.add::before { content: "+ "; color: var(--col-pastel-green); }
.change-title.update::before { content: "~ "; color: var(--col-pastel-blue); }
.change-title.delete::before { content: "− "; color: var(--col-pastel-red); }

.panel table {
  border-collapse: collapse;
  margin-top: 0.25rem;
  width: 100%;
}

.panel th,
.panel td {
  text-align: left;
  vertical-align: top;
  padding: 0.15rem 0.5rem 0.15rem 0;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.panel th {
  color: var(--col-light);
  width: 30%;
}

.panel tr.heading th {
  font-size: 0.8rem;
}

.panel .toggle {
  display: inline-flex;
  margin: 0.5rem 0;
  border: 1px solid var(--col-light);
  border-radius: 0.4rem;
  overflow: hidden;
}

.panel .toggle button {
  border: none;
  border-radius: 0;
  background: none;
  color: var(--col-lighter);
}

.panel .toggle button + button {
  border-left: 1px solid var(--col-light);
}

.panel .toggle button.on {
  background: var(--col-dark);
  color: var(--col-lightest);
}

.panel td.old {
  color: var(--col-pastel-red);
  text-decoration: line-through;
}

.panel td.new {
  color: var(--col-pastel-green);
}

.panel .warning,
.panel .error {
  color: var(--col-pastel-red);
  margin: 0.4rem 0;
  white-space: pre-line;
}

.panel .notice {
  color: var(--col-pastel-green);
}

.panel h3 {
  font-size: 1rem;
  color: var(--col-lightest);
  margin: 1.25rem 0 0.25rem;
}

/* Boxed blocks: each field in a layer's settings, and each layer in Moderate */

.panel .schema-field,
.panel .moderated > .change {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border: 0.1rem solid var(--col-dark);
  border-radius: 0.4rem;
}

.panel .schema-field > input,
.panel .schema-field .row > input {
  width: 100%;
  flex: 1;
}

.panel .schema-field .row {
  margin: 0.3rem 0;
}

.panel form.row input {
  flex: 1;
  min-width: 0;
}

/* "See more" in the layers control, which opens the community layers window */
.layer-control .see-more {
  font: inherit;
  font-size: 0.85em;
  color: var(--col-light);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

/* The community layers window: a dialog styled like the editor panel */
dialog.browse {
  width: min(32rem, calc(100vw - 2rem));
  border: none;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

dialog.browse:not([open]) {
  display: none;
}

dialog.browse::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

dialog.browse .browse-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0.5rem 0;
}

dialog.browse .browse-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.4rem 0.2rem;
  border-bottom: 0.1rem solid var(--col-dark);
}

dialog.browse .browse-row label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  cursor: pointer;
}

dialog.browse .gear {
  text-decoration: none;
  font-size: 2rem;
  align-self: center;
  line-height: 1;
}

dialog.browse .browse-row[hidden] {
  display: none;
}

dialog.browse .browse-text {
  flex: 1;
  min-width: 0;
}

dialog.browse .browse-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

dialog.browse .browse-name {
  color: var(--col-lightest);
}

dialog.browse .admins {
  margin-left: auto;
  text-align: right;
  font-size: 0.8rem;
  color: var(--col-light);
}

dialog.browse small {
  display: block;
  color: var(--col-light);
}

.panel .resolve {
  margin: 0.75rem 0;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--col-pastel-red);
  border-radius: 0.4rem;
}

.panel .conflict {
  margin: 0.4rem 0 0.6rem;
}

.panel .conflict .check {
  margin: 0.1rem 0;
}

.panel .conflict-field {
  color: var(--col-light);
  font-size: 0.8rem;
}

.panel .comment {
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: var(--col-dark);
  border-radius: 0.4rem;
  white-space: pre-line;
}

/* Your draft's changes, drawn over the map while you edit */

.diff-new,
.diff-warning,
.editing,
.connector {
  stroke-width: 3px;
}

.diff-new {
  stroke: var(--col-pastel-green);
  fill: var(--col-pastel-green);
  fill-opacity: 0.25;
}

.diff-warning {
  stroke: #ffd54a;
  fill: none;
}

path.editing {
  stroke: var(--col-pastel-blue);
  fill: var(--col-pastel-blue);
  fill-opacity: 0.2;
}

.point.editing {
  background: var(--col-pastel-blue);
}

.connector {
  stroke: var(--col-pastel-blue);
  stroke-dasharray: 4 4;
}

/* Directory */

#directory h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: var(--col-light);
  margin: 1.5rem 1.8rem 0.5rem;
}

#directory .layer-description {
  margin: -0.25rem 1.8rem 0.5rem;
  color: var(--col-light);
  font-size: 0.85rem;
  line-height: 1.3;
}

.item {
  font-size: 1rem;
  font-weight: 500;
  margin: 0.4rem;
}

.item summary {
  cursor: pointer;
  display: flex;
  list-style: none;
  transition: 0.2s all;
  border-radius: 0.5rem;
}

.item summary::-webkit-details-marker {
  display: none;
}

.item summary:hover,
.item summary.hover {
  background: var(--col-dark);
}

.itemleft {
  width: 85%;
  padding: 0.75rem 1.4rem;
}

.itemright {
  flex: 0 0 auto;
  width: 15%;
  min-width: 2.2rem;
  margin: 3px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The same width for every shape, so they line up. */
.swatch {
  width: 2.2rem;
}

/* A rounded bar, as all swatches used to be. */
.swatch-area {
  align-self: stretch;
  margin: 7px 0;
  border-radius: 100px;
}

.swatch-line {
  height: 0.8rem;
}

.swatch-point {
  width: 1.5rem;
  height: 1.75rem;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M12 28C10 24.5 0 19 0 12a12 12 0 0 1 24 0c0 7-10 12.5-12 16z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M12 28C10 24.5 0 19 0 12a12 12 0 0 1 24 0c0 7-10 12.5-12 16z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.itemcontent {
  padding: 1rem 2rem;
}

.itemcontent .reference {
  font-style: italic;
  color: #aaa;
  margin-bottom: 0.75rem;
}

.itemcontent .reference span {
  cursor: pointer;
  transition: 0.2s all;
}

.itemcontent .reference span + span::before {
  content: " / ";
}

.itemcontent .reference span:hover {
  color: var(--col-lightest);
}

.itemcontent .link {
  display: block;
  font-style: italic;
  color: var(--col-light);
  padding-bottom: 1rem;
  transition: 0.2s all;
}

.itemcontent .link:hover {
  color: var(--col-lightest);
}

.itemcontent .coords {
  font-family: var(--font-mono);
  color: var(--col-lightest);
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.itemcontent .text {
  font-size: 0.9rem;
  margin: 1rem 0;
  font-weight: 400;
}

.itemcontent .icon {
  display: inline-block;
  margin-right: 0.75rem;
  color: var(--col-light);
  transition: 0.2s all;
}

.itemcontent .icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-book:hover {
  color: var(--col-pastel-blue);
}

.icon-flag:hover {
  color: var(--col-pastel-green);
}

.icon-aperture:hover {
  color: var(--col-pastel-purple);
}

.icon-alert:hover {
  color: var(--col-pastel-red);
}

/* Sizing & layering */

.layers {
  margin: auto;
  width: 100%;
  height: 100%;
  background: inherit;
  z-index: 1;
}

.dynmap {
  opacity: var(--opacity-dynmap);
}

/* While a layer other than the base one is shown (see layer-control.ts) */
.covered .dynmap {
  opacity: var(--opacity-dynmap-faded);
}

/* A whole layer, faded (see fadeLayer) */
.leaflet-pane.faded {
  opacity: var(--opacity-faded);
}

/* Map objects */

.point {
  border-radius: 50%;
  background: var(--col-circles);
  transition: 0.2s box-shadow;
}

/* A ring around a dot, e.g. national exits */
.point.ring {
  box-sizing: border-box;
  border: 1.5px solid var(--col-circles);
  padding: 2px;
  background-clip: content-box;
}

.line {
  stroke: var(--col-lines);
  stroke-width: 2px;
  stroke-linecap: square;
  stroke-opacity: 0.5;
}

.polygon {
  stroke-width: 1.5px;
  fill-opacity: var(--opacity-polygons);
}

.point.highlight {
  box-shadow: 0 0 0 3px white;
}

.line.highlight {
  stroke: white;
  stroke-opacity: 1;
}

.polygon.highlight {
  fill-opacity: var(--opacity-polygons-hover);
}

/* Names inside polygons. The span is centered on the icon, which Leaflet
   centers on the label's point. */
.polygon-label span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--col-lightest);
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7), 0 0 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.polygon-label span.crowded {
  visibility: hidden;
}

.polygon-label.unmatched {
  opacity: 0.3;
}

/* Clicking an object focuses it; don't draw the browser's focus box. */
.leaflet-interactive:focus {
  outline: none;
}

/* Objects that don't match the search. Polygons stay as context. */
.point.unmatched,
.line.unmatched {
  display: none;
}

.polygon.unmatched {
  opacity: 0.3;
}

.hidden {
  display: none;
}

/* Holds the hatch patterns for disputed polygons */
.patterns {
  position: absolute;
  width: 0;
  height: 0;
}

/* Tooltips: tippy for icons, Leaflet's for map objects */

.leaflet-tooltip,
[data-tippy-root] {
  box-shadow: var(--box-shadow-dark);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  border: none !important;
  border-radius: 0.3rem;
  padding: .75rem;
  margin: 0;
  color: var(--col-lightest);
  background: var(--col-darker);
  overflow: hidden;
}

[data-tippy-root] div {
  background: inherit;
}

.leaflet-tooltip::before {
  display: none;
}

.leaflet-tooltip .name,
[data-tippy-root] .name {
  font-weight: 500;
}

.leaflet-tooltip .coords {
  font-family: var(--font-sans);
  color: var(--col-light);
  font-weight: 500;
}

/* Leaflet's controls, in dark boxes like the tooltips. The extra
   .leaflet-container beats Leaflet's own colors, borders, and shadows. */

.leaflet-container .leaflet-control {
  background: var(--col-darker);
  color: var(--col-lightest);
  border: none;
  border-radius: 0.3rem;
  box-shadow: var(--box-shadow);
}

/* The coordinates, today's date, and the layer list */
.leaflet-container .map-box,
.leaflet-container .leaflet-control-layers-expanded {
  padding: 0.6rem;
  line-height: 1.5rem;
  cursor: pointer;
}

.leaflet-container a.map-box:hover {
  color: var(--col-lighter);
}

/* Dark checkboxes */
.leaflet-control-layers {
  color-scheme: dark;
}

/* Our layers control: each layer with a handle to drag it up or down */
.layer-control {
  cursor: default;
  user-select: none;
}

.layer-control .layer-row {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  border-radius: 0.3rem;
}

.layer-control .layer-row.dragging {
  background: var(--col-dark);
}

.layer-control label {
  cursor: pointer;
}

.layer-control .handle {
  width: 1rem;
  padding: 0;
  font: inherit;
  color: var(--col-light);
  background: none;
  border: none;
  cursor: grab;
  touch-action: none;
}

.layer-control .dragging .handle {
  cursor: grabbing;
}

/* Zoom buttons */
.leaflet-container .leaflet-bar a {
  background: var(--col-darker);
  color: var(--col-lightest);
  border-bottom-color: var(--col-dark);
}

.leaflet-container .leaflet-bar a:hover,
.leaflet-container .leaflet-bar a:focus {
  background: var(--col-dark);
}

.leaflet-container .leaflet-bar a.leaflet-disabled {
  background: var(--col-darker);
  color: var(--col-light);
}

.leaflet-control-coordinates {
  cursor: pointer;
}

.mono {
  font-family: var(--font-mono);
}

.leaflet-control-coordinates strong {}

/* The accounts and audit log windows, in Moderate: the community layers window's look */
dialog.browse .banned,
dialog.browse .refused {
  font-size: 0.8rem;
  color: var(--col-pastel-red);
}

dialog.browse .browse-row > button {
  align-self: center;
}

/* Phones: the sidebar becomes a search bar above the map, and the directory
   takes the map's place when it's opened (see sidebar.ts). */

@media (max-width: 48rem) {
  body {
    flex-direction: column;
    height: 100dvh;
  }

  #sidebar {
    flex: none;
    display: flex;
    flex-direction: column;
    width: auto;
    height: auto;
    overflow: hidden;
  }

  .top {
    padding: 0.75rem;
  }

  .title,
  .subtitle,
  .info,
  .tiny,
  #directory {
    display: none;
  }

  .searchbox {
    display: flex;
    align-items: center;
    margin: 0;
  }

  .search {
    flex: 1;
    min-width: 0;
    width: auto;
    margin: 0;
  }

  /* Over the end of the search box, as before */
  .clear svg {
    top: 3px;
  }

  .directory-toggle,
  .account-toggle {
    display: block;
    font: inherit;
    font-weight: 500;
    color: var(--col-lightest);
    background: var(--col-dark);
    border: 0.1rem solid var(--col-light);
    border-radius: 0.5rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
  }

  .directory-toggle {
    margin-left: 0.75rem;
  }

  .account-toggle {
    background: var(--col-darker);
    box-shadow: var(--box-shadow);
  }

  #map {
    flex: 1;
    min-height: 0;
    width: auto;
    height: auto;
  }

  .directory-open #sidebar {
    flex: 1;
    min-height: 0;
  }

  .directory-open #directory {
    display: block;
    flex: 1;
    overflow-y: auto;
  }

  .directory-open #map {
    display: none;
  }

  /* The account box opens from its button, and the editor panel covers the
     map, its close button sticking at the top. The corner lets taps through
     to the map. */
  .corner {
    inset: 0;
    padding: 0.75rem;
    max-width: none;
    max-height: none;
    pointer-events: none;
  }

  .corner > * {
    pointer-events: auto;
  }

  .corner:not(.account-open) .account {
    display: none;
  }

  /* Editing isn't supported on phones. The panel still opens from links in
     our emails, like a change request or email settings. */
  .account .editing {
    display: none;
  }

  .account .no-editing {
    display: block;
    margin-top: 0.25rem;
  }

  .panel {
    position: absolute;
    inset: 0;
    width: auto;
    border-radius: 0;
    padding-top: 0;
  }

  .panel-head {
    position: sticky;
    top: 0;
    z-index: 1;
    align-items: center;
    padding-top: 0.5rem;
    background: var(--col-darker);
  }

  .panel .close {
    font-size: 2rem;
    padding: 0.25rem 0.5rem;
    margin-right: -0.5rem;
  }

  /* Marks the block the coordinate readout shows */
  .crosshair {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.25rem;
    height: 1.25rem;
    transform: translate(-50%, -50%);
    z-index: 700;
    pointer-events: none;
    background:
      linear-gradient(white, white) center / 2px 100% no-repeat,
      linear-gradient(white, white) center / 100% 2px no-repeat;
    filter: drop-shadow(0 0 1px black);
  }

  /* Leaflet's dark layers icon, made light for the dark box */
  .leaflet-container .leaflet-control-layers-toggle {
    filter: invert(1);
  }
}
