/* TalonWing Forge – industrial theme */
:root {
  --bg: #111315;
  --bg2: #16191b;
  --panel: #1c2023;
  --panel2: #242a2e;
  --line: #333a40;
  --line2: #454d54;
  --text: #d9dde0;
  --muted: #8d959c;
  --steel: #aab1b7;
  --accent: #d9722b;
  --accent2: #f0a050;
  --accent-dark: #8f4513;
  --ok: #5aa874;
  --warn: #d6a93a;
  --danger: #c9453a;
  --info: #5b8fbf;
  --radius: 4px;
  --heading: "Bahnschrift", "Oswald", "Arial Narrow", "Impact", "Segoe UI", sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); font: 15px/1.55 var(--body);
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(217,114,43,.10), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 2px, transparent 2px 4px),
    var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { color: #ffc27d; text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--heading); text-transform: uppercase; letter-spacing: .05em; line-height: 1.2; margin: 0 0 .6em; color: #eef0f2; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
code, pre { font-family: var(--mono); font-size: .9em; }
pre { background: #0d0f10; border: 1px solid var(--line); padding: .8em 1em; overflow: auto; border-radius: var(--radius); }
code { background: #0d0f10; padding: .1em .35em; border-radius: 3px; }
pre code { background: none; padding: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 22px; padding-bottom: 40px; }

/* header */
.announce { background: linear-gradient(90deg, #4a2410, #6b3414, #4a2410); color: #ffe2c4; text-align: center; padding: 7px 12px; font-size: .9rem; border-bottom: 1px solid #000; }
.announce a { color: #fff; text-decoration: underline; }
.site-header { background: linear-gradient(#262b2f, #181b1d); border-bottom: 3px solid #0a0b0c; box-shadow: 0 1px 0 #3a4147 inset, 0 6px 18px rgba(0,0,0,.5); position: relative; z-index: 20; }
.site-header .container { display: flex; align-items: center; gap: 18px; min-height: 144px; padding-top: 6px; padding-bottom: 6px; }
.brand { display: block; flex: none; line-height: 0; }
.brand img { height: 132px; width: auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
.btn.nav-toggle { display: none; margin-left: auto; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .nav button.linklike { color: #cfd4d8; font-family: var(--heading); text-transform: uppercase; letter-spacing: .08em; font-size: .95rem; padding: 9px 13px; border-radius: var(--radius); border: 1px solid transparent; background: none; cursor: pointer; }
.nav a:hover, .nav button.linklike:hover { color: #fff; background: #2c3237; text-decoration: none; border-color: var(--line2); }
.nav a.active { color: #fff; background: #2c3237; border-color: var(--accent-dark); box-shadow: 0 2px 0 var(--accent) inset; }
.nav .badge-count { background: var(--danger); color: #fff; font-size: .72rem; border-radius: 10px; padding: 0 6px; margin-left: 4px; }
.usermenu { position: relative; }
.usermenu > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; border: 1px solid var(--line2); border-radius: var(--radius); background: #20252a; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.6); padding: 6px; z-index: 30; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 3px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; text-transform: none; letter-spacing: 0; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--panel2); text-decoration: none; }
.usermenu .menu hr { margin: 6px 0; }
.avatar { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; border: 2px solid #4a525a; background: #0d0f10; vertical-align: middle; }
.avatar.sm { width: 28px; height: 28px; } .avatar.lg { width: 96px; height: 96px; } .avatar.xl { width: 140px; height: 140px; border-radius: 6px; }

/* panels (riveted plates) */
.panel { position: relative; background: linear-gradient(#20252a, #1a1e21); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; box-shadow: 0 1px 0 #2e353b inset, 0 4px 14px rgba(0,0,0,.35); }
.panel.rivets::before, .panel.rivets::after { content: ""; position: absolute; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #cfd4d8, #5a6167 60%, #2a2e31); box-shadow: 0 1px 1px #000; }
.panel.rivets::before { left: 7px; } .panel.rivets::after { right: 7px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 2px solid var(--accent-dark); padding-bottom: 10px; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--steel); }

/* buttons */
.btn, button.btn, input[type=submit].btn {
  display: inline-block; font: 600 .9rem var(--heading); text-transform: uppercase; letter-spacing: .08em; color: #e8ebed;
  background: linear-gradient(#4a5258, #333a3f); border: 1px solid #1a1d1f; border-top-color: #66707a; border-radius: var(--radius);
  padding: 8px 16px; cursor: pointer; text-decoration: none; box-shadow: 0 2px 0 #14161a; line-height: 1.3;
}
.btn:hover { color: #fff; background: linear-gradient(#58626a, #3b4348); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #14161a; }
.btn-primary { background: linear-gradient(#e8833a, #b85a1c); border-color: #5c2a08; border-top-color: #f4a064; color: #fff; }
.btn-primary:hover { background: linear-gradient(#f2924a, #c8651f); }
.btn-danger { background: linear-gradient(#c9453a, #8e2a22); border-color: #4a120d; border-top-color: #e0675d; color: #fff; }
.btn-danger:hover { background: linear-gradient(#d9554a, #a2332b); }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line2); }
.btn-sm { padding: 4px 10px; font-size: .78rem; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.inline { display: inline; }
form.inline-form { display: inline-block; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* forms */
label { display: block; font-size: .85rem; color: var(--steel); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], input[type=file], input[type=date], select, textarea {
  width: 100%; background: #0e1012; color: var(--text); border: 1px solid var(--line2); border-radius: var(--radius); padding: 9px 11px; font: inherit;
  box-shadow: 0 2px 4px rgba(0,0,0,.5) inset;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-dark); border-color: var(--accent); }
textarea { min-height: 130px; resize: vertical; font-family: var(--body); }
textarea.code { font-family: var(--mono); font-size: .9rem; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 8px; text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--text); }
.check input { margin-top: 4px; }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.form-narrow { max-width: 640px; }

/* flash + alerts */
.flash, .alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; border-left-width: 5px; }
.flash.ok, .alert.ok { background: #14261b; border-color: #2d5a3d; color: #b6e6c6; }
.flash.error, .alert.error { background: #2a1513; border-color: #6a2b25; color: #f1c2bd; }
.flash.warn, .alert.warn { background: #2a2310; border-color: #6d5a1c; color: #f0dca0; }
.flash.info, .alert.info { background: #12202c; border-color: #2c516f; color: #bcd8ef; }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font: 600 .78rem var(--heading); text-transform: uppercase; letter-spacing: .08em; color: var(--steel); background: #15181a; border-bottom: 2px solid var(--line2); padding: 9px 10px; white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.table td.actions-cell { white-space: nowrap; text-align: right; }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font: 600 .7rem var(--heading); text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--line2); background: #262b2f; color: var(--steel); vertical-align: middle; }
.badge.owner { background: linear-gradient(#7a2a1a, #4a1209); color: #ffd9b8; border-color: #b4472b; }
.badge.full_admin { background: #5a2a1a; color: #ffcfa8; border-color: #9a4a25; }
.badge.admin { background: #4a3314; color: #ffd98f; border-color: #8a6320; }
.badge.moderator { background: #1c3a2e; color: #a9e6c9; border-color: #2f7357; }
.badge.ok, .badge.active, .badge.published, .badge.trialing { background: #17301f; color: #a8e2bb; border-color: #2f7046; }
.badge.warn, .badge.pending, .badge.past_due, .badge.coming_soon { background: #33290e; color: #f1d98b; border-color: #85691c; }
.badge.bad, .badge.banned, .badge.rejected, .badge.expired, .badge.suspended, .badge.canceled { background: #35161a; color: #f1b3b6; border-color: #86303a; }
.badge.inactive, .badge.hidden, .badge.deleted { background: #262a2d; color: #9aa1a7; }
.badge.official { background: #17283a; color: #a9cdee; border-color: #2d5a85; }
.badge.community { background: #2d2340; color: #cdb8f0; border-color: #5a4388; }

/* grids / cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { position: relative; background: linear-gradient(#22272b, #1a1d20); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.card:hover { border-color: var(--accent-dark); }
.card .thumb { aspect-ratio: 16/9; background: #0d0f10 center/cover no-repeat; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); font: 700 1.4rem var(--heading); }
.card .body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card h3 { margin: 0; font-size: 1.05rem; } .card h3 a { color: #f1f3f4; }
.card .foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: linear-gradient(#22272b, #1a1d20); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; }
.stat .n { font: 700 1.9rem var(--heading); color: #fff; line-height: 1.1; }
.stat .l { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat a { display: block; color: inherit; } .stat a:hover { text-decoration: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.kv dd { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line2); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; font: 600 .9rem var(--heading); text-transform: uppercase; letter-spacing: .08em; color: var(--steel); border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: -2px; }
.tabs a.active { background: var(--panel); color: #fff; border-color: var(--line2); border-bottom: 2px solid var(--panel); }
.tabs a:hover { text-decoration: none; color: #fff; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.pager a, .pager span { padding: 4px 11px; border: 1px solid var(--line2); border-radius: var(--radius); background: var(--panel); color: var(--steel); font-size: .88rem; }
.pager span.cur { background: var(--accent-dark); color: #fff; border-color: var(--accent); }
.pager a:hover { background: var(--panel2); text-decoration: none; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filter-bar .field { margin: 0; min-width: 160px; }
.filter-bar input, .filter-bar select { padding: 7px 10px; }

/* ratings */
.stars { color: var(--accent2); letter-spacing: 2px; white-space: nowrap; }
.stars .off { color: #3c4349; }
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.rating-input input { position: absolute; opacity: 0; }
.rating-input label { font-size: 1.8rem; color: #3c4349; cursor: pointer; margin: 0; text-transform: none; letter-spacing: 0; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: var(--accent2); }
.bar { height: 8px; background: #0d0f10; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(#f0a050, #c8651f); }
.spark { display: block; max-width: 100%; height: auto; }

/* forums */
.forum-cat { margin-bottom: 22px; }
.forum-cat > h2 { background: linear-gradient(#2d3338, #22272b); border: 1px solid var(--line2); border-left: 5px solid var(--accent); padding: 8px 14px; margin: 0; font-size: 1.05rem; }
.forum-row { display: grid; grid-template-columns: 1fr 90px 90px 240px; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-top: 0; background: var(--panel); }
.forum-row:nth-child(odd) { background: #1e2225; }
.forum-row .t a { font: 600 1.05rem var(--heading); text-transform: uppercase; letter-spacing: .04em; }
.forum-row .num { text-align: center; color: var(--muted); font-size: .85rem; }
.forum-row .num b { display: block; color: #fff; font-size: 1.15rem; font-family: var(--heading); }
.thread-row { display: grid; grid-template-columns: 1fr 80px 80px 220px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.thread-row:hover { background: rgba(255,255,255,.025); }
.thread-row .t a { font-weight: 600; }
.post { display: grid; grid-template-columns: 190px minmax(0, 1fr); border: 1px solid var(--line); background: var(--panel); margin-bottom: 14px; border-radius: var(--radius); overflow: hidden; }
.post .author { background: #171a1d; border-right: 1px solid var(--line); padding: 14px; text-align: center; font-size: .85rem; }
.post .author .name { font: 600 1.05rem var(--heading); text-transform: uppercase; display: block; margin: 8px 0 2px; word-break: break-word; }
.post .content { padding: 14px 18px; min-width: 0; display: flex; flex-direction: column; }
.post .meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.post .text { flex: 1; overflow-wrap: anywhere; }
.post .sig { margin-top: 14px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: .82rem; color: var(--muted); }
.post.deleted .text { opacity: .55; font-style: italic; }
.post .tools { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.prose { overflow-wrap: anywhere; }
.prose img { max-height: 520px; border-radius: 3px; border: 1px solid var(--line); }
.prose blockquote { margin: .8em 0; padding: .4em 1em; border-left: 4px solid var(--accent-dark); background: rgba(255,255,255,.03); color: #b8bec3; }
.prose table { border-collapse: collapse; } .prose th, .prose td { border: 1px solid var(--line2); padding: 5px 9px; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.2em; }

/* admin shell */
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.admin-side { position: sticky; top: 12px; background: linear-gradient(#20252a, #181b1d); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.admin-side h4 { font-size: .72rem; color: var(--muted); margin: 14px 8px 4px; letter-spacing: .14em; }
.admin-side h4:first-child { margin-top: 4px; }
.admin-side a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 3px; color: #cfd4d8; font-size: .93rem; }
.admin-side a:hover { background: var(--panel2); text-decoration: none; }
.admin-side a.active { background: #2f2218; color: #fff; box-shadow: 3px 0 0 var(--accent) inset; }
.footer { border-top: 3px solid #0a0b0c; background: #0e1011; color: var(--muted); padding: 22px 0; font-size: .85rem; box-shadow: 0 1px 0 #2a3035 inset; }
.footer .container { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .two-col, .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .forum-row, .thread-row { grid-template-columns: 1fr 70px; }
  .forum-row .last, .thread-row .last, .forum-row .num:nth-child(3), .thread-row .num:nth-child(3) { display: none; }
  .post { grid-template-columns: 1fr; } .post .author { display: flex; gap: 12px; align-items: center; text-align: left; border-right: 0; border-bottom: 1px solid var(--line); }
  .post .author .name { margin: 0; }
}
@media (max-width: 760px) {
  .site-header .container { flex-wrap: wrap; min-height: 96px; }
  .brand img { height: 88px; }
  .btn.nav-toggle { display: inline-block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; margin: 0 0 10px; }
  .nav.open { display: flex; }
  .usermenu .menu { position: static; box-shadow: none; }
}

/* module: forums */
.tools details { display: inline-block; vertical-align: top; }
.tools details > summary::-webkit-details-marker { display: none; }
.tools details[open] { flex-basis: 100%; }
.post .author .avatar.lg { margin: 0 auto; display: block; }
.thread-row .t .badge { margin-right: 4px; }


