/* talkhaus sites: modelled on the forum theme (styles/talkhaus/theme/talkhaus.css). No framework, no build step. */
:root {
  --bg: #2b2b2b;
  --frame: #812b2b;
  --frame-border: #6d6d6d;
  --red: #973328;
  --red-light: #ad473c;
  --panel: #f3f3f3;
  --text: #1c1c1c;
  --muted: #5f6476;
  --link: #105289;
  --ok-bg: #dff2d8;
  --err: #a12a1f;
  --err-bg: #f9dedb;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font: 14px/1.5 Verdana, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: transparent;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6em; margin: 0.3em 0; }
h2 { font-size: 1.2em; margin: 0.5em 0; }

#gradient-top {
  position: absolute; top: 0; left: 0; right: 0; height: 110px; z-index: -1;
  background: linear-gradient(to bottom, #121212 0%, #2b2b2b 100%);
}
#site-header { height: 140px; display: flex; justify-content: center; align-items: center; }
#site-header img { max-width: 100%; height: auto; display: block; }
@media (max-width: 700px) { #site-header { height: auto; padding: 8px 0; } }

#main-container {
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid var(--frame-border);
  border-radius: 8px;
  background: var(--frame);
}
@media (max-width: 1230px) { #main-container { margin: 0 16px; } }

#navbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px;
  padding: 9px 14px; font-weight: bold;
}
#navbar a, #navbar .who, #navbar button.link { color: #aaa; font-weight: bold; }
#navbar a:hover, #navbar button.link:hover { color: #fff; text-decoration: none; }
#navbar .spacer { flex: 1; }
#navbar .who { color: #ddd; }

#inner-container {
  background: #fff;
  border-radius: 5px;
  margin: 4px;
  padding: 12px 16px 20px;
  min-height: 300px;
}

footer { text-align: center; color: #999; font-size: 11px; padding: 14px 16px 30px; }
footer a { color: #bbb; }

.panel { background: var(--panel); border: 1px solid #ddd; border-radius: 6px; padding: 10px 16px; margin: 14px 0; }
.panel.narrow { max-width: 560px; margin: 20px auto; }
.intro { text-align: center; padding: 6px 0 10px; }
.muted { color: var(--muted); }
.flash { background: var(--ok-bg); border: 1px solid #b9dcae; border-radius: 4px; padding: 6px 10px; }
.error { color: var(--err); }
p.error { background: var(--err-bg); border: 1px solid #ebb9b3; border-radius: 4px; padding: 6px 10px; }
.prose li { margin: 0.3em 0; }

/* forms and buttons */
input, select, textarea, button, .button {
  font: inherit; font-size: 13px;
  border: 1px solid #b4b4b4; border-radius: 4px; padding: 4px 8px; background: #fff; color: var(--text);
}
button, .button {
  cursor: pointer; display: inline-block;
  background: linear-gradient(to bottom, #fff 0%, #e9e9e9 100%);
}
button:hover, .button:hover { border-color: #0a8ed0; text-decoration: none; }
button.primary, .button.primary {
  color: #fff; border-color: #7d2a20; font-weight: bold;
  background: linear-gradient(to bottom, var(--red-light) 0%, var(--red) 100%);
}
button.danger { color: var(--err); }
button.link { border: 0; background: none; padding: 0; color: var(--link); }
.button.small, button.small, summary.button.small { padding: 1px 7px; font-size: 12px; }
form.inline { display: inline; }
form.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
form.stack { display: flex; flex-direction: column; gap: 10px; }
form.stack label { display: flex; flex-direction: column; gap: 3px; }
label.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 6px; }
input.short { width: 7em; }
.address { display: flex; align-items: center; gap: 2px; font-weight: bold; }
.address input { flex: 1; min-width: 0; }

/* index gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid #ddd; border-radius: 6px;
  overflow: hidden; color: var(--text);
}
.card:hover { border-color: var(--red); text-decoration: none; }
.card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #ddd; display: block; }
.card span { padding: 6px 10px; font-weight: bold; overflow-wrap: anywhere; }
.my-sites { list-style: none; padding: 0; }
.my-sites li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 0; }
.sitename { font-weight: bold; }

/* file manager */
.site-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.usage { display: flex; align-items: center; gap: 8px; }
.usage meter { width: 160px; }
.crumbs { margin: 8px 0; overflow-wrap: anywhere; }
table.files { width: 100%; border-collapse: collapse; margin: 10px 0; }
table.files th { text-align: left; font-size: 12px; color: var(--muted); border-bottom: 2px solid #ddd; padding: 4px 6px; }
table.files td { border-bottom: 1px solid #eee; padding: 5px 6px; vertical-align: middle; }
table.files td.name { overflow-wrap: anywhere; }
table.files .num { text-align: right; white-space: nowrap; }
table.files td.actions { text-align: right; white-space: nowrap; }
table.log td { font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  table.files th:nth-child(3), table.files td:nth-child(3) { display: none; }
}
details.menu { display: inline-block; position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu .popup {
  position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid #bbb; border-radius: 6px;
  padding: 6px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.2); min-width: 280px; text-align: left;
}
.tools { display: flex; flex-wrap: wrap; gap: 6px 30px; }
.editor { display: flex; flex-direction: column; gap: 8px; }
.editor textarea { width: 100%; min-height: 60vh; font: 13px/1.45 ui-monospace, Consolas, monospace; tab-size: 2; }
h1.path { font-size: 1.2em; overflow-wrap: anywhere; }

/* uploader */
.dropzone { border: 2px dashed #bbb; border-radius: 8px; padding: 8px 16px; margin: 10px 0; background: #fafafa; }
.dropzone.over { border-color: var(--red); background: #fff3f1; }
#upload-list { list-style: none; padding: 0; margin: 0; }
#upload-list li { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; align-items: center; padding: 2px 0; font-size: 12px; }
#upload-list li .n { overflow-wrap: anywhere; }
#upload-list li progress { width: 140px; }
#upload-list li.failed .s { color: var(--err); }
#upload-list li.done .s { color: #2f7d22; }

.inline-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.danger-zone { border-color: #ebb9b3; }

/* admin "view as" mode */
#view-as-bar {
  position: sticky; bottom: 0; z-index: 10; text-align: center; padding: 8px 16px;
  background: #ffe36e; color: #000; border-top: 3px solid #c79a00; font-weight: bold;
}
body:has(#view-as-bar) footer { padding-bottom: 10px; }
