/* GeoMillCities portal: Windows 2000 look, AA contrast underneath. */
:root {
  --bg: #d4d0c8;          /* Win2000 3D face */
  --panel: #ffffff;
  --text: #000000;
  --link: #0000cc;
  --visited: #551a8b;
  --title-bg: #0a246a;
  /* Real Win2000 fades to #a6caf0, which fails AA under white text; #3a6ea5 passes (5.2:1). */
  --title-grad: linear-gradient(90deg, #0a246a, #3a6ea5);
  --title-text: #ffffff;
  --bevel-light: #ffffff;
  --bevel-mid: #808080;
  --bevel-dark: #404040;
  --select: #0a246a;      /* highlighted menu item / selection */
  --focus: #ffcc00;
  --error: #a00000;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* components set display; hidden must still win */
body {
  margin: 0;
  overflow-wrap: break-word; /* long titles and URLs wrap instead of overflowing */
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Tahoma, Verdana, Geneva, sans-serif;
}
a { color: var(--link); }
a:visited { color: var(--visited); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px #000; }

.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; }

/* Header (ADR-030): a title bar (logo + account "tray"), then an
   Explorer-style toolbar of flat icon buttons that bevel on hover. */
.masthead { background: var(--bg); border-bottom: 1px solid var(--bevel-dark); box-shadow: 0 1px var(--bevel-mid); }
.titlebar {
  background: var(--title-grad); color: var(--title-text);
  padding: .5rem 1rem; display: flex; flex-wrap: wrap; gap: .25rem 2rem; align-items: center;
}
.titlebar a { color: var(--title-text); }
.logo { margin: 0; font: bold 1.75rem "Times New Roman", serif; font-style: italic; }
.logo a { text-decoration: none; }
.tagline { margin: 0; flex: 1; }
.masthead ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.masthead form { margin: 0; }
.tray-link, .tray-link:visited { color: var(--title-text); }
.coolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .2rem .75rem; }
.coolbar nav { flex: 1 1 auto; }
.coolbar ul { gap: 0; }
.coolbar a, .coolbar a:visited {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; min-width: 4.5rem;
  padding: .25rem .5rem; color: #000; text-decoration: none; font-size: .9rem;
  border: 1px solid transparent;
}
.coolbar a:hover { border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light); }
.coolbar a[aria-current="page"] {
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  background: repeating-conic-gradient(var(--bg) 0 25%, #fff 0 50%) 0 0 / 2px 2px;  /* Win2000 "pressed" dither */
  font-weight: bold;
}
.coolbar img { image-rendering: pixelated; }
.coolbar-search { display: flex; align-items: center; gap: .4rem; }
.coolbar-search label { display: flex; align-items: center; gap: .3rem; }
.coolbar-search input { width: 11rem; max-width: 40vw; font: inherit; padding: .1rem .3rem; }
@media (max-width: 40rem) {
  .coolbar a { min-width: 0; font-size: .8rem; padding: .2rem .3rem; }
  .coolbar-search { flex: 1 1 100%; }
  .coolbar-search input { flex: 1; width: auto; max-width: none; }
}

main { max-width: 60rem; margin: 1.5rem auto; padding: 0 1rem; }
main:focus { outline: none; }

.btn {
  display: inline-block; font: inherit; color: #000; text-decoration: none; cursor: pointer;
  background: var(--bg); padding: .25rem .9rem;
  /* Win2000 two-layer bevel: outer border plus an inner shadow line. */
  border: 1px solid; border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: inset -1px -1px var(--bevel-mid), inset 1px 1px var(--bg);
}
.btn:link, .btn:visited { color: #000; }  /* link-buttons act like Windows buttons, not links */
.btn:active, .btn[aria-pressed="true"] {
  border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark);
  box-shadow: inset 1px 1px var(--bevel-mid);
}
.btn:disabled { color: #595959; cursor: default; }
/* The default button gets the dark Win2000 frame. */
.btn--primary { outline: 1px solid #000; outline-offset: 0; }
.btn--primary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.window {
  background: var(--bg); max-width: 32rem; margin: 0 auto; padding: 2px;
  border: 1px solid; border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: inset -1px -1px var(--bevel-mid), inset 1px 1px var(--bg);
}
.window-title { margin: 0; font-size: 1rem; background: var(--title-grad); color: var(--title-text); padding: .2rem .5rem; }
.window-body { padding: 1rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: bold; }
.field input, .field select { font: inherit; width: 100%; padding: .25rem; background: #fff; }
/* Sunken Win2000 field: grey/white outer edge, dark inner edge. */
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea,
.gm-field input, .gm-field textarea, .searchbar input, .editor-titlerow input:not([type="checkbox"]), .sunken {
  border: 1px solid; border-color: var(--bevel-mid) var(--bevel-light) var(--bevel-light) var(--bevel-mid);
  box-shadow: inset 1px 1px var(--bevel-dark), inset -1px -1px var(--bg);
}
.help { margin: .25rem 0 0; font-size: .875rem; }
.help ul { margin: .25rem 0; padding-left: 1.25rem; }
.error, .errors { color: var(--error); font-weight: bold; }

.site-footer { text-align: center; padding: 1rem; font-size: .875rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Guestbook form when re-shown on the portal after an error */
.gm-field { margin-bottom: 1rem; }
.gm-field label { display: block; font-weight: bold; }
.gm-field input, .gm-field textarea { font: inherit; width: 100%; padding: .25rem; background: #fff; }
.gm-error { color: var(--error); font-weight: bold; margin: .25rem 0 0; }
.gm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gm-btn { font: inherit; cursor: pointer; background: var(--bg); padding: .25rem .9rem; border: 1px solid; border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light); box-shadow: inset -1px -1px var(--bevel-mid); }

/* --- messages, utilities ------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: #333; font-size: .875rem; }
.badge { background: #ffcc00; color: #000; font-weight: bold; padding: 0 .4rem; border: 1px solid #000; }
/* Accessible Homestead seal: sunken Win2000 status field with a green check.
   Sunken = a display, so it stands out without looking clickable. Same look as .gm-seal on member pages. */
.seal {
  display: inline-flex; align-items: center; gap: .35em; padding: .05em .55em .05em .3em;
  background: #f2f8f0; color: #000; font-weight: bold; white-space: nowrap;
  border: 1px solid var(--bevel-mid); box-shadow: inset 1px 1px var(--bevel-dark);  /* frame shows on white and grey alike */
}
.seal__icon { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; font-size: .9em; line-height: 1; background: #1e7b1e; color: #fff; border: 1px solid #0d4d0d; }
.messages { margin-bottom: 1rem; }
.msg { margin: 0 0 .5rem; padding: .5rem .75rem; background: #ffffe1; border: 1px solid #000; }
.msg--error { background: #ffe1e1; color: var(--error); font-weight: bold; }
.btn--primary { font-weight: bold; }
code { font-family: "Courier New", monospace; }

/* --- File Manager -------------------------------------------------------- */
main.wide { max-width: 90rem; }
.fm-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); }
.fm-grid .window { max-width: none; margin: 0; min-width: 0; }
.fm-table { width: 100%; border-collapse: collapse; background: #fff; }
.fm-table th, .fm-table td { border: 1px solid #808080; padding: .25rem .5rem; text-align: left; vertical-align: top; }
/* File names and titles may break long unbroken strings; headers and buttons never do. */
.fm-table .wrap { overflow-wrap: anywhere; }
@media (min-width: 40rem) { .fm-table th.wrap { min-width: 7rem; } } /* keep short names like index.html whole */
.fm-table thead th, .btn { white-space: nowrap; }
.fm-actions { display: flex; gap: .25rem; flex-wrap: wrap; } /* a div inside the cell, so the cell stays a table cell */
.fm-actions form, .fm-files form { margin: 0; display: inline; }
.gb-list { list-style: none; padding: 0; }
.gb-list li { border-bottom: 1px dotted #808080; padding-bottom: .5rem; margin-bottom: .5rem; }
.gb-list blockquote { margin: .25rem 0 .5rem 1rem; background: #fff; padding: .5rem; }
.gb-actions { display: flex; gap: .5rem; }


/* --- portal (Yahoo '98) -------------------------------------------------- */
.searchbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }
.searchbar input { font: inherit; padding: .25rem; background: #fff; flex: 1; min-width: 12rem; max-width: 30rem; }
/* Home intro: plain white panel, black on white (21:1) */
.home-intro { background: var(--panel); border: 1px solid #808080; padding: .5rem .75rem; margin-bottom: .75rem; }
.home-intro h1 { font-size: 1.4rem; margin: 0 0 .25rem; color: var(--title-bg); }
.home-intro p { margin: 0; max-width: 60rem; }
.portal-news { background: #fff; border: 1px solid #808080; padding: .25rem .5rem; margin-bottom: 1rem; }
.portal { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 52rem) { .portal { grid-template-columns: 1fr; } }
.section-title { font-size: 1.25rem; background: var(--title-grad); color: var(--title-text); padding: .2rem .5rem; margin: 0 0 .75rem; }
.hood .section-title { background: var(--hood); }
.directory { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .75rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
/* Directory tiles: the whole tile is the link (stretched ::after), and names stay
   navy instead of turning visited-purple, since these are navigation, not reading links. */
.directory li {
  position: relative; background: #fff; padding: .45rem .6rem .5rem .7rem;
  border: 1px solid var(--bevel-mid); border-left: 6px solid var(--hood, var(--title-bg));
  box-shadow: 1px 1px 0 var(--bevel-light) inset;
}
.directory li:hover { background: #eef2fb; border-color: var(--title-bg); border-left-color: var(--hood, var(--title-bg)); }
.directory li:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px #000; }
.dir-name, .dir-name:visited { font-weight: bold; font-size: 1.1rem; color: var(--title-bg); text-decoration: none; }
.dir-name::after { content: ""; position: absolute; inset: 0; }
.dir-name:focus-visible { outline: none; box-shadow: none; }  /* the tile shows focus instead */
.directory li:hover .dir-name { text-decoration: underline; }
.dir-blurb { display: block; font-size: .875rem; }
.count { font-size: .875rem; }
.btn--block { display: block; text-align: center; }
.post-list { list-style: none; margin: 0; }
.post-list li { padding: .25rem 0; border-bottom: 1px dotted #808080; overflow-wrap: anywhere; }
.post-list li:last-child { border-bottom: 0; }
.post-meta { display: block; font-size: .8rem; color: #333; }
.box { background: #fff; border: 1px solid #000; margin-bottom: 1rem; }
.box-title { margin: 0; font-size: 1rem; background: var(--title-grad); color: var(--title-text); padding: .2rem .5rem; }
.hood .box-title { background: var(--hood); }
.box-body { padding: .5rem .75rem; margin: 0; }
.box--cool .box-title { background: #ffcc00; color: #000; }
.cool-name { font-size: 1.2rem; font-weight: bold; margin: 0; }
.side-link { margin: -.5rem 0 1rem; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1px dotted #808080; }
.stats dt { font-weight: normal; }
.stats dd { margin: 0; font-weight: bold; }
.site-list { list-style: square; padding-left: 1.25rem; }
.site-list li { margin-bottom: .25rem; }
.badge--sm { font-size: .75rem; }
.box textarea { width: 100%; font: 12px "Courier New", monospace; }
.crumbs { font-size: .875rem; margin-bottom: .5rem; }
.lede { font-size: 1.1rem; max-width: 50rem; }
.prose { background: var(--panel); border: 1px solid #808080; padding: .75rem 1.25rem; max-width: 50rem; }
.prose h2 { margin-top: 1.5rem; }
.note { background: #ffffe1; border: 1px solid #000; padding: .5rem; }

/* neighborhood identity */
.hood { background: var(--hood-tint); padding: 1rem; border: 3px solid var(--hood); }
.hood-head { border-bottom: 4px double var(--hood); margin-bottom: 1rem; }
.hood-head h1 { color: var(--hood); margin: .25rem 0; }
.hood-banner { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.hood-blurb { font-size: 1.1rem; }
.block { margin-bottom: 1rem; border-left: 6px solid var(--hood, var(--title-bg)); padding-left: .75rem; }
.block h3 { margin: .25rem 0; }
.landmarks { columns: 2 14rem; }

/* bulletin board (vBulletin-ish) */
.bbs { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 1rem; }
.bbs th, .bbs td { border: 1px solid #808080; padding: .4rem .5rem; text-align: left; }
.bbs tbody th { overflow-wrap: anywhere; }
.bbs thead th { background: var(--hood, var(--title-bg)); color: #fff; }
.bbs .alt1, .post.alt1 { background: #f5f5ff; }
.bbs .alt2, .post.alt2 { background: #e8e8f4; }
.posts { list-style: none; padding: 0; }
.post { display: grid; grid-template-columns: 12rem 1fr; border: 1px solid #808080; margin-bottom: .5rem; }
@media (max-width: 40rem) { .post { grid-template-columns: 1fr; } }
.post-author { padding: .5rem; border-right: 1px solid #808080; display: flex; flex-direction: column; gap: .25rem; }
.post-body { padding: .5rem .75rem; }
.post-meta { margin: 0; font-size: .8rem; }
.post-tools { margin: 0; font-size: .8rem; text-align: right; }
.pager { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.window--wide { max-width: 48rem; margin: 1rem 0; }
.quote { background: #fff; padding: .5rem; border-left: 4px solid #808080; margin: 0 0 1rem; }
fieldset.field { border: 1px solid #808080; padding: .5rem .75rem; }
fieldset.field legend { font-weight: bold; }
/* Radios sit inline before their labels; undo the full-width .field input rule. */
.radio { display: flex; align-items: center; gap: .5rem; margin: .35rem 0; }
.field .radio input { width: auto; margin: 0; flex: none; }
.field .radio label { display: inline; font-weight: normal; cursor: pointer; }
.field textarea { font: inherit; width: 100%; padding: .25rem; background: #fff; }
.field--check { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.field--check input { width: auto; margin: 0; }
.field--check label { display: inline; flex: 1; min-width: 0; }
.field--check .help, .field--check .error { flex-basis: 100%; margin: .25rem 0 0; }
.crumbs { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; font-size: .875rem; }
.crumbs li + li::before { content: "\203A"; padding: 0 .4rem; }

/* Grid/flex children default to min-width: auto, so one long unbroken title
   could widen a whole column past the screen. Let them shrink and wrap. */
.portal > *, .directory > li, .fm-grid > * { min-width: 0; }
.site-list li, .cool-name, .dir-name, .post-body { overflow-wrap: anywhere; }

/* Moderation console (staff only) */
.mod-nav, .mod-tabs { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1rem; }
.mod-tabs a { display: inline-block; padding: .25rem .6rem; border: 1px solid #000; background: #fff; color: #000; }
.mod-tabs a[aria-current="page"], .mod-nav a[aria-current="page"] { background: #000080; color: #fff; font-weight: bold; }
.mod-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.mod-item .window-title { font-size: 1rem; overflow-wrap: anywhere; }
.mod-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.mod-excerpt { margin: .5rem 0; padding: .5rem; background: #fff; border-left: 4px solid #808080; overflow-wrap: anywhere; white-space: pre-wrap; }
.mod-excerpt mark, .mod-table mark { background: #ffff00; color: #000; font-weight: bold; }
.mod-reasons { margin: .25rem 0 .75rem; }
.mod-bulk { margin-bottom: 1rem; }
.mod-table { width: 100%; }
.mod-terms summary { cursor: pointer; font-weight: bold; margin: .5rem 0; }
.post--held { outline: 2px dashed #000; outline-offset: -2px; }

/* --- Win2000 components -------------------------------------------------- */
/* Property-sheet tabs: the selected tab is raised and joins the panel below. */
.tabs { list-style: none; display: flex; flex-wrap: wrap; align-items: flex-end; margin: 0; padding: 0 .25rem; }
.tabs a {
  display: block; padding: .2rem .75rem; margin-top: 3px; color: #000; text-decoration: none; background: var(--bg);
  border: 1px solid; border-bottom: 0; border-color: var(--bevel-light) var(--bevel-dark) transparent var(--bevel-light);
  border-radius: 3px 3px 0 0; box-shadow: inset -1px 0 var(--bevel-mid);
}
.tabs a:visited { color: #000; }
.tabs a[aria-current="page"] { margin-top: 0; padding-bottom: .4rem; margin-bottom: -1px; font-weight: bold; position: relative; z-index: 1; }
.tab-panel {
  background: var(--bg); padding: 1rem;
  border: 1px solid; border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: inset -1px -1px var(--bevel-mid);
}
/* Etched group box around a set of related fields. */
.groupbox { border: 1px solid var(--bevel-mid); box-shadow: inset 1px 1px var(--bevel-light), 1px 1px var(--bevel-light); padding: .5rem .75rem .75rem; margin: 0 0 1rem; min-width: 0; }
.groupbox > legend { font-weight: bold; padding: 0 .25rem; }
.groupbox > :last-child { margin-bottom: 0; }
/* Sunken status bar panes along the bottom of a window. */
.statusbar { display: flex; flex-wrap: wrap; gap: 2px; margin: 2px 0 0; font-size: .875rem; }
.statusbar > * { margin: 0; padding: 0 .4rem; border: 1px solid; border-color: var(--bevel-mid) var(--bevel-light) var(--bevel-light) var(--bevel-mid); }
.statusbar > :first-child { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .25rem; border-bottom: 1px solid var(--bevel-mid); box-shadow: 0 1px var(--bevel-light); }
.toolbar-sep { align-self: stretch; width: 2px; margin: 0 .25rem; border-left: 1px solid var(--bevel-mid); border-right: 1px solid var(--bevel-light); }
/* Drop-down menu built on <details>: no ARIA menu roles, just buttons in a list. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " \25BE"; }
.menu[open] > summary { border-color: var(--bevel-dark) var(--bevel-light) var(--bevel-light) var(--bevel-dark); box-shadow: inset 1px 1px var(--bevel-mid); }
.menu-list {
  position: absolute; z-index: 30; top: calc(100% + 2px); left: 0; min-width: 15rem; margin: 0; padding: 2px; list-style: none;
  background: var(--bg); border: 1px solid; border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: inset -1px -1px var(--bevel-mid), 2px 2px 0 rgba(0, 0, 0, .35);
}
.menu-list button { display: block; width: 100%; text-align: left; font: inherit; color: #000; background: none; border: 0; padding: .3rem 1.25rem; cursor: pointer; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--select); color: #fff; }
.menu-list .menu-note { padding: .3rem 1.25rem; font-size: .875rem; }
/* Title-bar close button: only where it really closes something. */
.title-btn {
  flex: none; width: 1.5rem; height: 1.35rem; padding: 0; font: bold .9rem/1 Tahoma, sans-serif; color: #000; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; background: var(--bg); cursor: pointer;
  border: 1px solid; border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  box-shadow: inset -1px -1px var(--bevel-mid);
}
.title-btn:visited { color: #000; }
.window-title--bar { display: flex; align-items: center; gap: .5rem; }
.window-title--bar > :first-child { flex: 1; min-width: 0; margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
/* Win2000 progress bar: sunken white trough, navy blocks with gaps. */
.progress { height: 1.3rem; padding: 2px; background: #fff;
  border: 1px solid; border-color: var(--bevel-mid) var(--bevel-light) var(--bevel-light) var(--bevel-mid);
  box-shadow: inset 1px 1px var(--bevel-dark), inset -1px -1px var(--bg); }
.progress__fill { display: block; height: 100%; max-width: 100%;
  background: repeating-linear-gradient(90deg, var(--select) 0 .5rem, transparent .5rem .65rem); }
.progress--full .progress__fill { background: repeating-linear-gradient(90deg, var(--error) 0 .5rem, transparent .5rem .65rem); }
.quota-text { margin: 0 0 .3rem; }
.info-bar { margin: 0; padding: .3rem .5rem; background: #ffffe1; border-bottom: 1px solid var(--bevel-mid); }

/* --- app pages (File Manager, editor): slim taskbar header ----------------- */
body.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.app .titlebar { padding: .2rem .75rem; gap: .25rem 1rem; }
body.app .logo { font-size: 1.25rem; }
body.app .tagline { visibility: hidden; height: 0; }  /* keeps the flex spacer, drops the text */
body.app .masthead .btn { padding: .1rem .6rem; }
/* App pages need the room: icons sit beside their labels. */
body.app .coolbar { padding: 0 .5rem; }
body.app .coolbar a { flex-direction: row; min-width: 0; padding: .1rem .4rem; gap: .3rem; }
body.app main { max-width: none; width: 100%; margin: .5rem 0; padding: 0 .5rem; flex: 1; display: flex; flex-direction: column; min-height: 0; }
body.app .messages { margin-bottom: .5rem; }
body.app .site-footer { padding: .25rem; font-size: .8rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; }
body.app .site-footer p { margin: 0; }

/* --- File Manager (Explorer) ------------------------------------------- */
.explorer { max-width: 80rem; width: 100%; margin: 0 auto; }
.addressbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .25rem; border-bottom: 1px solid var(--bevel-mid); box-shadow: 0 1px var(--bevel-light); }
.addressbar .sunken { flex: 1 1 14rem; min-width: 0; background: #fff; padding: .1rem .4rem; }
.explorer-body { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: .75rem; padding: .75rem .5rem; }
@media (max-width: 48rem) {
  .explorer-body { grid-template-columns: minmax(0, 1fr); }
  .task-group--tasks { display: none; }  /* same links as the tabs; saves a screenful on phones */
}
.taskpane { display: grid; gap: .75rem; align-content: start; }
.task-group { background: #fff; border: 1px solid var(--bevel-mid); }
.task-group h2 { margin: 0; padding: .2rem .5rem; font-size: .95rem; color: #fff; background: var(--title-grad); }
.task-group ul { list-style: none; margin: 0; padding: .4rem .5rem; }
.task-group li { padding: .15rem 0; }
.task-group > p, .task-group > div { margin: 0; padding: .4rem .5rem; font-size: .9rem; }
.explorer-main { min-width: 0; }
.explorer-main .tab-panel > h2 { margin-top: 0; font-size: 1.1rem; }
/* Every data table gets title-bar headers: white bold on the gradient (5.2:1 at the light end). */
.fm-table thead th { background: var(--title-grad); color: var(--title-text); font-weight: bold; border-color: var(--title-bg); }
.fm-thumb { display: block; width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; background: #fff; }
.form-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

/* --- editor ---------------------------------------------------------------- */
/* Wide screens: the editor window fills the space under the header, so code and
   preview sit side by side with no page scroll. Narrow screens stack normally. */
.editor-app { max-width: none; width: 100%; margin: 0; display: flex; flex-direction: column; }
.editor-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.editor-titlerow { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; padding: .35rem .5rem; margin: 0; }
.editor-titlerow label { font-weight: bold; }
.editor-titlerow input:not([type="checkbox"]) { flex: 1; min-width: 10rem; width: auto; font: inherit; padding: .1rem .3rem; background: #fff; }
.editor-titlerow input[type="checkbox"] + label { font-weight: normal; }
.editor-titlerow .error { flex-basis: 100%; margin: 0; }
.editor-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; padding: 0 .5rem .25rem; flex: 1; min-height: 0; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 .75rem; margin: 0 0 .15rem; }
.pane-head label, .pane-head h2 { font-weight: bold; font-size: 1rem; margin: 0; }
.pane-head .help { margin: 0; font-size: .8rem; }
.pane-code textarea { flex: 1; width: 100%; min-height: 20rem; font: 14px/1.4 "Courier New", monospace; }
.pane-code .cm-editor { flex: 1; min-height: 0; background: #fff; font-size: 14px;
  border: 1px solid; border-color: var(--bevel-mid) var(--bevel-light) var(--bevel-light) var(--bevel-mid); box-shadow: inset 1px 1px var(--bevel-dark); }
.pane-code .cm-editor.cm-focused { outline: 3px solid var(--focus); outline-offset: 2px; }
#gm-preview { flex: 1; min-height: 12rem; width: 100%; background: #fff;
  border: 1px solid; border-color: var(--bevel-mid) var(--bevel-light) var(--bevel-light) var(--bevel-mid); box-shadow: inset 1px 1px var(--bevel-dark); }
.a11y-report { flex: none; max-height: 40%; overflow: auto; background: #fff; margin-top: .35rem; border: 1px solid var(--bevel-mid); }
.a11y-report summary { padding: .25rem .5rem; cursor: pointer; font-weight: bold; background: var(--bg); position: sticky; top: 0; }
.a11y-report > p, .a11y-report > ul { margin: .4rem .75rem; }
.a11y-report li { margin-bottom: .4rem; }
.a11y-report code { display: inline-block; margin-top: .25rem; font-size: .8rem; word-break: break-all; }
.editor-app .statusbar { padding: 0 2px 2px; }
.statusbar label { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.view-toggle { display: none; }
@media (min-width: 60.01rem) {
  body.editor-page { height: 100vh; height: 100dvh; }
  body.editor-page .editor-app { flex: 1; min-height: 0; }
}
@media (max-width: 60rem) {
  .editor-split { grid-template-columns: minmax(0, 1fr); }
  .pane { height: 75vh; }
  .js .view-toggle { display: inline-flex; gap: .25rem; }
  .js .editor-split[data-view="code"] .pane-preview, .js .editor-split[data-view="preview"] .pane-code { display: none; }
}

/* Clip art dialog */
.dialog { margin: auto; padding: 2px; max-width: min(56rem, calc(100vw - 1rem)); width: 100%; color: #000;
  height: min(34rem, calc(100dvh - 2rem)); }  /* fixed height: switching categories doesn't make it jump */
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: rgba(0, 0, 0, .35); }
.dialog-body { padding: .5rem; display: flex; flex-direction: column; gap: .5rem; min-height: 0; flex: 1; }
.cat-tabs { display: flex; flex-wrap: wrap; gap: .25rem; }
.clip-main { display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: .5rem; min-height: 0; flex: 1; }
@media (max-width: 40rem) { .clip-main { grid-template-columns: minmax(0, 1fr); } .clip-preview { display: none; } }
.clip-grids { background: #fff; overflow: auto; min-height: 0; padding: .25rem;
  border: 1px solid; border-color: var(--bevel-mid) var(--bevel-light) var(--bevel-light) var(--bevel-mid); box-shadow: inset 1px 1px var(--bevel-dark); }
.clip-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.clip {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .2rem; width: 100%; height: 5.5rem;
  padding: .25rem; font: .75rem Tahoma, sans-serif; color: #000; background: #fff; border: 1px dotted transparent; cursor: pointer;
}
.clip img { width: 88px; height: 3.25rem; object-fit: contain; image-rendering: pixelated; }
.clip span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip[aria-pressed="true"] { background: var(--select); color: #fff; border-color: #000; }
.clip-preview { background: var(--bg); display: flex; flex-direction: column; gap: .35rem; }
.clip-preview .clip-stage { flex: 1; min-height: 8rem; display: flex; align-items: center; justify-content: center; background: #fff; padding: .5rem;
  border: 1px solid; border-color: var(--bevel-mid) var(--bevel-light) var(--bevel-light) var(--bevel-mid); }
.clip-stage img { max-width: 100%; max-height: 12rem; image-rendering: pixelated; }
.clip-preview p { margin: 0; font-size: .875rem; overflow-wrap: anywhere; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: .5rem; }
.dialog-buttons .btn { min-width: 6rem; text-align: center; }
.addressbar .sunken { margin: 0; }
.groupbox--after { margin-top: 1rem; }

/* Account deletion banner: top of every page while a deletion is pending.
   White on #a00000 is 7.2:1. */
.deletion-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem;
  padding: .5rem 1rem; background: var(--error); color: #fff; border-bottom: 2px solid #000; }
.deletion-banner p { margin: 0; max-width: 60rem; }
.deletion-banner strong { text-transform: uppercase; letter-spacing: .03em; }
.deletion-banner a, .deletion-banner a:visited { color: #fff; }
.deletion-banner form { margin: 0; }

/* --- blog editor (WYSIWYG) ------------------------------------------------- */
.blog-editor { max-width: 64rem; margin: 0 auto; }
.wys-toolbar select { font: inherit; padding: .15rem .25rem; background: #fff; }
.wys-btn[aria-pressed="true"] { background: #e8e6e0; }
.wys-panes { padding: .25rem .5rem; margin: 0; }
.wys-tabs { display: flex; gap: .25rem; margin-bottom: .35rem; }
.wys-design { min-height: 22rem; max-height: 65vh; overflow: auto; padding: .75rem 1rem; background: #fff; color: #000;
  font: 16px/1.5 "Times New Roman", Times, serif; overflow-wrap: anywhere; }
.wys-design:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.wys-design img { max-width: 100%; height: auto; image-rendering: pixelated; }
.wys-panes textarea { width: 100%; min-height: 22rem; font: 14px/1.4 "Courier New", monospace; }
.swatches { min-width: 10rem; }
.swatches button { display: flex; align-items: center; gap: .5rem; }
.swatch { display: inline-block; width: 1rem; height: 1rem; border: 1px solid #000; }
.dialog--small { max-width: min(30rem, calc(100vw - 1rem)); height: fit-content; }  /* auto would stretch a modal top to bottom */

.template-picker .radio { align-items: flex-start; flex-wrap: wrap; }
.template-picker .radio label { flex: 1; min-width: 12rem; }
.template-picker .radio .help { display: block; }

/* --- template gallery ------------------------------------------------------ */
.tpl-head h1 { margin-bottom: .25rem; }
.tpl-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 48rem) { .tpl-layout { grid-template-columns: minmax(0, 1fr); } }
.tpl-cats { list-style: none; margin: 0; }
.tpl-cats li { padding: .15rem 0; }
.tpl-cats a[aria-current="page"] { font-weight: bold; color: #000; text-decoration: none; }
.tpl-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.tpl-card { background: #fff; border: 1px solid var(--bevel-mid); box-shadow: 1px 1px 0 var(--bevel-light) inset; display: flex; flex-direction: column; min-width: 0; }
.tpl-card:hover, .tpl-card:focus-within { border-color: var(--title-bg); }
/* Live mini preview: the real page rendered 4x the card's size, scaled to 25%,
   so it fills the card at any width. Sandboxed (no scripts/forms), decorative. */
.tpl-thumb { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #fff; border-bottom: 1px solid var(--bevel-mid); }
.tpl-thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; border: 0; transform-origin: 0 0; transform: scale(.25); pointer-events: none; }
.tpl-info { padding: .4rem .6rem .6rem; }
.tpl-info h3 { margin: 0 0 .2rem; font-size: 1rem; overflow-wrap: anywhere; }
.tpl-name, .tpl-name:visited { color: var(--title-bg); }
.tpl-meta { margin: 0; font-size: .85rem; }
.tpl-badge { vertical-align: middle; image-rendering: pixelated; }
.stars { color: #8a5a00; letter-spacing: .05em; }
.tpl-detail { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1rem; align-items: start; }
@media (max-width: 60rem) { .tpl-detail { grid-template-columns: minmax(0, 1fr); } }
.tpl-preview-win { max-width: none; margin: 0; }
.tpl-big { display: block; width: 100%; height: 70vh; min-height: 24rem; border: 1px solid var(--bevel-mid); background: #fff; }
.tpl-open { margin: .25rem .5rem; }
.tpl-aside .groupbox:last-child { margin-bottom: 0; }
.editor-titlerow select { font: inherit; padding: .1rem .25rem; background: #fff; }

/* --- Canal Critters (ADR-029) ------------------------------------------- */
.critter-img, .critter-art img, .guide-entry img { image-rendering: pixelated; }
.critter-panel h2 { font-size: 1.15rem; }
.critter-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.critter-card { display: flex; gap: .6rem; align-items: flex-start; background: #fff; padding: .5rem; border: 1px solid var(--bevel-mid); min-width: 0; }
.critter-card > div { min-width: 0; }
.critter-card p { margin: 0 0 .3rem; overflow-wrap: anywhere; }
.critter-card__name { font-weight: bold; }
.critter-card__desc { font-size: .9rem; }
.critter-card form { margin: 0; }
.critter-window { max-width: 44rem; margin: 0; }
.critter-window section { border-top: 1px solid var(--bevel-mid); box-shadow: inset 0 1px var(--bevel-light); }
.critter-window h2 { font-size: 1.05rem; margin-top: 0; }
.critter-body { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.critter-art { background: #fff; padding: .5rem; border: 1px solid; border-color: var(--bevel-mid) var(--bevel-light) var(--bevel-light) var(--bevel-mid); }
.critter-facts { flex: 1 1 16rem; min-width: 0; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .2rem .75rem; margin: 0 0 .75rem; }
.facts dt { font-weight: bold; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.growth { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.growth__label { margin: 0 0 .15rem; }
.embed-code { width: 100%; font: 14px "Courier New", monospace; margin: .25rem 0; }
.embed-label { display: block; font-weight: normal; font-size: .875rem; margin-top: .3rem; }
.fm-table .embed-code { min-width: 0; font-size: 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; margin: .75rem 0; }
.inline-form .help { flex-basis: 100%; }
.guide-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.guide-entry { background: #fff; border: 1px solid var(--bevel-mid); padding: .75rem; text-align: center; min-width: 0; }
.guide-entry h3 { margin: .25rem 0; font-size: 1.05rem; }
.guide-entry p { margin: .25rem 0; text-align: left; }
.family ul { margin: .2rem 0; }
.critter-mini { list-style: none; display: grid; gap: .4rem; }
.critter-mini li { display: flex; gap: .5rem; align-items: center; overflow-wrap: anywhere; }
.critter-mini img { flex: none; }
