/* Shared by the district pages: form fields, buttons and the gold district accent. */
:root { --gold: #C2B560; --gold-ink: #111518; --pin: #C2B560; --land: rgba(255,255,255,.075); --land-line: rgba(255,255,255,.17); --state-line: rgba(255,255,255,.42); }
:root[data-theme="light"] { --pin: #1C5A7D; --land: rgba(28,90,125,.09); --land-line: rgba(28,90,125,.2); --state-line: rgba(28,90,125,.55); }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.d-field { display: block; margin-bottom: 18px; }
.d-field > span { display: block; font: 600 14px/1.3 var(--sans); color: var(--ink); margin-bottom: 6px; }
.d-field small { display: block; font: 400 13.5px/1.45 var(--sans); color: var(--muted); margin-top: 6px; }
.d-input { width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 4px; border: 1px solid var(--glass-2); background: var(--field, transparent); color: var(--ink); font: 400 16px/1.4 var(--sans); caret-color: var(--accent); }
textarea.d-input { min-height: 150px; resize: vertical; line-height: 1.5; }
.d-input:focus-visible, .d-btn:focus-visible, .d-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.d-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 3px; border: 1px solid var(--glass-2); background: none; color: var(--ink); font: 600 15px var(--sans); cursor: pointer; text-decoration: none; transition: background .15s ease-out; }
.d-btn:hover { background: var(--panel3); }
.d-btn.primary { background: var(--gold); border-color: transparent; color: var(--gold-ink); }
.d-btn.primary:hover { background: #D0C473; }
.d-btn:disabled { opacity: .55; cursor: default; }
.d-err { color: var(--bad); font: 500 14.5px/1.45 var(--sans); min-height: 20px; }
.d-avatar { width: 52px; height: 52px; flex: none; border-radius: 12px; object-fit: cover; background: var(--panel3); color: var(--muted); display: grid; place-items: center; font: 600 16px var(--sans); }

.d-sort { display: inline-flex; align-items: center; gap: 8px; font: 600 13.5px var(--sans); color: var(--muted); margin: 0 0 12px; }
.d-sort select { min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--glass-2); background: var(--field, transparent); color: var(--ink); font: 500 14.5px var(--sans); }
.d-sort select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.d-group { font: 600 13.5px var(--sans); color: var(--muted); padding: 14px 10px 4px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.d-group small { font: 600 13px var(--sans); font-variant-numeric: tabular-nums; }
tr.d-group-row th { padding: 16px 10px 6px; color: var(--ink); font: 600 14px var(--sans); border-bottom: 1px solid var(--glass-2); }

/* Area colours on the map: UPCI blue, gold and green. Every area also has its name on the map and in the key. */
:root { --area-0: #5FB0DC; --area-1: #D8C865; --area-2: #5CC48F; --area-3: #C79BE8; --area-out: rgba(255,255,255,.03); }
:root[data-theme="light"] { --area-0: #1C5A7D; --area-1: #A8921F; --area-2: #2D7150; --area-3: #6A4BA8; --area-out: rgba(20,30,40,.045); }

.d-social { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: -8px; border-radius: 10px; color: var(--accent); font-size: 21px; text-decoration: none; }
.d-social:hover { background: var(--panel3); }
.d-social:focus-visible { outline: 2px solid var(--accent); }

/* Links stay the same colour after they've been opened. */
.d-social, .d-social:visited, .wrap a:visited, .atlas a:visited { color: var(--accent); }
.c-main:visited { color: var(--ink); }
/* A text box that is also a dropdown. See js/combo.js. */
.combo { position: relative; display: block; }
.combo .d-input { padding-right: 44px; }
.combo-arrow { position: absolute; top: 0; right: 0; bottom: 0; width: 44px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.combo-list { position: fixed; z-index: 400; list-style: none; margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--glass-2); border-radius: 10px; background: var(--surface-solid, var(--panel)); color: var(--ink); box-shadow: 0 8px 24px rgba(20, 30, 40, .18); scrollbar-width: thin; }
.combo-list li { display: flex; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: 7px; font: 400 15.5px/1.3 var(--sans); cursor: pointer; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--panel3); }
.combo-list li.combo-none { color: var(--muted); cursor: default; background: none; }
/* Headshots are often taller than the square they sit in. Keep the top of the photo, where the face is. */
img.d-avatar, img.p-face, .e-frame img { object-fit: cover; object-position: 50% 6%; }
/* A photo opened large. See js/photo-view.js. */
.zoomable { display: block; flex: none; padding: 0; border: 0; border-radius: 14px; background: none; line-height: 0; cursor: zoom-in; }
.zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-view { margin: auto; padding: 0; border: 0; background: none; overflow: visible; max-width: min(92vw, 900px); cursor: zoom-out; }
.photo-view[open] { animation: photo-open .28s cubic-bezier(.16,1,.3,1); }
.photo-view::backdrop { background: rgba(10, 15, 20, .82); }
.photo-view img { display: block; max-width: 100%; max-height: 88dvh; border-radius: 14px; }
.photo-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(10, 15, 20, .6); color: #fff; font-size: 20px; cursor: pointer; }
.photo-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes photo-open { from { opacity: 0; transform: scale(.94); } }
@media (prefers-reduced-motion: reduce) { .photo-view[open] { animation: none; } }
/* Photo cropper. See js/photo-crop.js. */
.e-crop, .p-crop { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 18px; padding: 14px; border: 1px solid var(--glass); border-radius: 12px; }
.crop-stage { display: block; flex: none; width: min(280px, 100%); aspect-ratio: 1; max-width: 100%; border-radius: 14px; background: var(--panel3); cursor: grab; touch-action: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crop-tools { flex: 1 1 200px; min-width: 0; }
.crop-tools p { font-size: 15px; line-height: 1.4; color: var(--muted); }
.crop-zoom { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 8px 0 12px; color: var(--muted); font-size: 19px; }
.crop-zoom input { flex: 1; min-width: 0; accent-color: var(--accent); }
.crop-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.p-crop[hidden] { display: none; }
