html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 340px;
}

#sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 340px;
    box-sizing: border-box;
    overflow-y: auto;
    background: #fafafa;
    border-left: 1px solid #ddd;
}

#sidebar section {
    padding: 10px 14px;
    border-bottom: 1px solid #e3e3e3;
}

/* the filters can be folded away, the status line below stays */
#filters summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

#filters[open] summary {
    margin-bottom: 4px;
}

h2 {
    font-size: 14px;
    margin: 0 0 6px;
}

label {
    display: block;
    margin: 4px 0;
    cursor: pointer;
}

/* small caps group heading, so the structure is visible without shouting */
.label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #777;
    margin: 14px 0 5px;
}

.label:first-child {
    margin-top: 0;
}

label.field {
    margin: 8px 0 0;
    font-size: 12px;
    color: #444;
}

.hint.note {
    color: #c2650a;
}

input[type=text], select {
    width: 100%;
    box-sizing: border-box;
    padding: 4px;
    margin-top: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}

button {
    padding: 5px 10px;
    border: 1px solid #bbb;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

button:hover {
    background: #f0f0f0;
}

button.primary {
    background: #2d7dd2;
    border-color: #2d7dd2;
    color: #fff;
}

button.primary:hover {
    background: #246bb5;
}

button:disabled {
    opacity: .5;
    cursor: default;
}

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

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #333;
    vertical-align: middle;
    margin: 0 4px;
}

.dot.maxheight { background: #e6194b; }
.dot.maxweight { background: #f58231; }
.dot.bridge { background: #4363d8; }

.hint {
    color: #555;
    font-size: 12px;
    margin: 6px 0 0;
}

.hint.warn {
    color: #a33;
}

#status {
    margin-top: 10px;
    color: #555;
    font-size: 12px;
}

#photo img {
    width: 100%;
    display: block;
    border-radius: 3px;
    margin-bottom: 4px;
}

/* own row with a real click target, so they cannot be hit by accident when picking a way */
#edit-links {
    display: flex;
    gap: 8px;
    margin: 8px 0 16px;
}

#edit-links a {
    flex: 1;
    padding: 6px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    color: #246bb5;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
}

#edit-links a:hover {
    background: #f0f0f0;
}

#way-picker {
    margin-top: 0;
}

#way-state:empty, #edit-hint:empty {
    display: none;
}

#pending input[type=text] {
    margin-top: 5px;
}

/* rarely needed, but the way out for everything this app does not do - so it sits at the bottom */
#way-links {
    margin-top: 10px;
    font-size: 11px;
}

#way-links a {
    display: inline-block;
    padding: 3px 0;
    color: #246bb5;
}

#way-picker button {
    margin: 0 4px 4px 0;
    font-size: 12px;
}

#way-picker button.selected {
    background: #2d7dd2;
    border-color: #2d7dd2;
    color: #fff;
}

.tag {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    align-items: center;
}

.tag {
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
}

.tag .key {
    flex: 0 0 42%;
    color: #555;
}

input.changed {
    border-color: #2d7dd2;
    background: #eaf2fb;
}

#edit-fields label.field {
    margin-top: 6px;
}

#edit-fields label.field:first-child {
    margin-top: 0;
}

#all-tags {
    margin-top: 10px;
    font-size: 12px;
}

#all-tags summary {
    cursor: pointer;
    color: #555;
}

.pending-item {
    border-top: 1px solid #eee;
    padding: 6px 0;
    font-size: 12px;
}

/* the remove link sits at the right edge, so it cannot be read as part of the tag change */
.pending-title {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.pending-item code {
    display: block;
    color: #246bb5;
    word-break: break-all;
}

.pending-item a {
    cursor: pointer;
}
