/* ============================================================
   iLog1K_web - dark theme built around the iLog1K logo
   Palette sampled from the logo: molten orange, red shadow,
   golden highlight, on near-black warmed with brown.
   ============================================================ */

:root {
    --bg:        #0b0805;
    --bg-2:      #14100a;
    --panel:     rgba(28, 20, 14, 0.72);
    --panel-2:   rgba(38, 27, 18, 0.85);
    --line:      rgba(255, 122, 24, 0.20);
    --line-soft: rgba(200, 150, 110, 0.14);

    /* Logo colours */
    --flame:     #ff7a18;   /* main orange - the body of the logo   */
    --ember:     #f5301b;   /* deep red    - the drop shadow        */
    --gold:      #ffb627;   /* highlight   - the lit top edge       */

    --lime:      #8fe063;   /* success - warmed so it fits the set  */
    --amber:     #ffc248;
    --red:       #ff4d3d;

    --text:      #f2e6da;
    --text-dim:  #b6a08c;
    --text-mute: #7d6a5a;

    --r:  10px;
    --r-l: 16px;
    --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Rajdhani", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---- animated grid backdrop ---- */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(1000px 600px at 15% -10%, rgba(255, 122, 24,.10), transparent 60%),
        radial-gradient(900px 500px at 90% 0%, rgba(255, 61, 31,.08), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.grid-bg::after {
    content: "";
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(rgba(255, 122, 24,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 122, 24,.045) 1px, transparent 1px);
    background-size: 46px 46px;
    transform: perspective(500px) rotateX(58deg);
    transform-origin: 50% 0;
    animation: gridflow 22s linear infinite;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 70%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 70%);
}
@keyframes gridflow { to { background-position: 0 46px, 0 0; } }

@media (prefers-reduced-motion: reduce) {
    .grid-bg::after { animation: none; }
}

a { color: var(--flame); text-decoration: none; transition: color .15s; }
a:hover { color: #ffa657; }

.muted     { color: var(--text-mute); }
.dim       { color: var(--text-dim); }
.mono      { font-family: var(--mono); }

/* ---------------- top bar ---------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(12, 8, 5, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: "Orbitron", sans-serif;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: .06em;
    color: var(--text);
}
.brand:hover { color: var(--text); }

/* Logo. max-height wins over the intrinsic image size no matter how large
   the source PNG is; width:auto keeps the aspect ratio. */
.brand-logo {
    height: 56px;
    max-height: 56px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 14px rgba(255, 90, 20, .32));
    transition: filter .2s;
}
.brand:hover .brand-logo { filter: drop-shadow(0 0 22px rgba(255, 120, 30, .55)); }

@media (max-width: 560px) {
    .brand-logo { height: 40px; max-height: 40px; max-width: 210px; }
}
.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-weight: 600;
    flex-wrap: wrap;
}
.nav > a { color: var(--text-dim); letter-spacing: .03em; }
.nav > a:hover { color: var(--flame); }
.usermenu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 14px;
    border-left: 1px solid var(--line-soft);
}
.uname { color: var(--ember); font-family: var(--mono); font-size: 14px; }

/* ---------------- layout ---------------- */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 60px;
    min-height: 60vh;
}

.footer {
    border-top: 1px solid var(--line);
    background: rgba(12, 8, 5, .78);
    margin-top: 40px;
}
.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 20px 26px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.6fr;
    gap: 30px;
    color: var(--text-mute);
    font-size: 14px;
}
.footer-logo {
    height: 62px;
    max-height: 62px;
    width: auto;
    max-width: 320px;
    object-fit: contain;
    display: block;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 16px rgba(255, 90, 20, .3));
}
.footer-brand p { margin: 0; max-width: 34ch; }

.footer-col h4 {
    font-family: "Orbitron", sans-serif;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0 0 12px;
}
.footer-col { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.footer-col a { color: var(--text-mute); font-size: 14.5px; }
.footer-col a:hover { color: var(--flame); }
.footer-note { margin: 0 0 10px; font-size: 13px; line-height: 1.55; }

.footer-bar {
    border-top: 1px solid var(--line-soft);
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 20px 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13.5px;
    color: var(--text-dim);
}

@media (max-width: 900px) {
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 560px) {
    .footer-inner { grid-template-columns: 1fr; }
}

/* ---------------- typography ---------------- */
h1, h2, h3 {
    font-family: "Orbitron", sans-serif;
    letter-spacing: .04em;
    margin: 0 0 .5em;
    line-height: 1.2;
}
h1 { font-size: clamp(24px, 4vw, 34px); }
h2 { font-size: 21px; }
h3 { font-size: 17px; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

/* ---------------- hero ---------------- */
.hero {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    background: var(--panel);
    padding: 38px 30px;
    margin-bottom: 30px;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255, 122, 24,.10), transparent 45%, rgba(255, 61, 31,.09));
    pointer-events: none;
}
/* Same top-lit ramp as the logo: golden highlight above, molten orange
   through the middle, red where the shadow falls. */
.hero h1 {
    position: relative;
    display: inline-block;
    background: linear-gradient(170deg, var(--gold) 0%, var(--flame) 48%, var(--ember) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 10px rgba(245, 48, 27, .28));
}
.hero p { position: relative; color: var(--text-dim); max-width: 60ch; margin: 0; }
.hero-stats {
    position: relative;
    display: flex;
    gap: 26px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.hero-stats div { font-family: var(--mono); font-size: 13px; color: var(--text-mute); }
.hero-stats b {
    display: block;
    font-family: "Orbitron", sans-serif;
    font-size: 24px;
    color: var(--flame);
}

/* ---------------- buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: rgba(255, 122, 24, .06);
    color: var(--text);
    font-family: "Rajdhani", sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .04em;
    cursor: pointer;
    transition: all .16s ease;
    white-space: nowrap;
}
.btn:hover {
    color: #fff;
    border-color: var(--flame);
    background: rgba(255, 122, 24, .14);
    box-shadow: 0 0 18px rgba(255, 122, 24, .22);
}
/* Primary action: the logo's molten gradient, gold on top fading to red. */
.btn-neon {
    border-color: rgba(255, 122, 24, .5);
    background: linear-gradient(160deg, rgba(255, 182, 39, .28), rgba(245, 48, 27, .22));
    color: #fff1e4;
}
.btn-neon:hover {
    border-color: var(--gold);
    background: linear-gradient(160deg, rgba(255, 182, 39, .42), rgba(245, 48, 27, .32));
    box-shadow: 0 0 22px rgba(255, 122, 24, .3);
}
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-danger { border-color: rgba(255,77,94,.4); background: rgba(255,77,94,.08); color: #ffb3ba; }
.btn-danger:hover { border-color: var(--red); background: rgba(255,77,94,.18); box-shadow: 0 0 18px rgba(255,77,94,.25); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- cards / grid ---------------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}
.card {
    position: relative;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-l);
    background: var(--panel);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .18s, border-color .18s, box-shadow .18s;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--ember), var(--flame) 45%, var(--gold));
    opacity: .6;
}
.card:hover {
    transform: translateY(-3px);
    border-color: var(--line);
    box-shadow: 0 10px 34px rgba(255, 122, 24, .10);
}
.card h3 { margin: 0; font-size: 16px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--flame); }
.card-sum { color: var(--text-dim); font-size: 15px; flex: 1; margin: 0; }
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-mute);
    font-family: var(--mono);
    flex-wrap: wrap;
}

/* ---------------- badges ---------------- */
.badges { display: flex; gap: 7px; flex-wrap: wrap; }
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .07em;
    border: 1px solid currentColor;
    opacity: .92;
}
.badge-plugin  { color: var(--flame); }
.badge-script  { color: var(--lime); }
.badge-tools   { color: #6fd7e8; }   /* the one cool accent - tools read apart */
.badge-project { color: var(--gold); }
.badge-other   { color: var(--text-mute); }
.badge-vsro    { color: var(--amber); }
.badge-isro-r  { color: var(--ember); }
.badge-both    { color: #ffd9a8; }   /* pale gold, so it reads apart from VSRO */
.badge-open        { color: var(--amber); }
.badge-in_progress { color: var(--flame); }
.badge-fixed       { color: var(--lime); }
.badge-closed      { color: var(--text-mute); }
.badge-admin   { color: var(--ember); }
.badge-user    { color: var(--text-mute); }

/* ---------------- forms ---------------- */
.panel {
    border: 1px solid var(--line-soft);
    border-radius: var(--r-l);
    background: var(--panel);
    padding: 22px;
    margin-bottom: 20px;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }

.form { display: flex; flex-direction: column; gap: 15px; }
.form-row { display: flex; gap: 15px; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 200px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-mute);
    font-weight: 600;
}
input[type=text], input[type=email], input[type=password], input[type=search],
select, textarea {
    width: 100%;
    padding: 10px 13px;
    border-radius: var(--r);
    border: 1px solid var(--line-soft);
    background: rgba(11, 7, 4, .6);
    color: var(--text);
    font-family: "Rajdhani", sans-serif;
    font-size: 15.5px;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--flame);
    box-shadow: 0 0 0 3px rgba(255, 122, 24, .12);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
select option { background: var(--bg-2); }

.auth-wrap { max-width: 420px; margin: 40px auto; }

/* ---------------- flash ---------------- */
.flash {
    border-radius: var(--r);
    padding: 11px 15px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 122, 24, .07);
    font-weight: 600;
}
.flash-ok   { border-color: rgba(124,255,90,.4);  background: rgba(124,255,90,.08);  color: #c9ffb8; }
.flash-err  { border-color: rgba(255,77,94,.4);   background: rgba(255,77,94,.08);   color: #ffbcc2; }
.flash-warn { border-color: rgba(255,176,32,.4);  background: rgba(255,176,32,.08);  color: #ffdfa8; }

/* ---------------- toolbar / filters ---------------- */
.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-l);
    background: var(--panel);
}
.toolbar input[type=search] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; flex: 0 0 auto; }

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
    padding: 9px 16px;
    border: none;
    background: transparent;
    color: var(--text-mute);
    font-family: "Orbitron", sans-serif;
    font-size: 12.5px;
    letter-spacing: .07em;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s;
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--flame); border-bottom-color: var(--flame); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------- vote bar ---------------- */
.votebar { display: flex; align-items: center; gap: 10px; }
.vote {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(11, 7, 4, .5);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
}
.vote:hover { border-color: var(--line); color: var(--text); }
.vote.up.active   { color: var(--lime); border-color: var(--lime); box-shadow: 0 0 14px rgba(124,255,90,.2); }
.vote.down.active { color: var(--red);  border-color: var(--red);  box-shadow: 0 0 14px rgba(255,77,94,.2); }

/* ---------------- code / files ---------------- */
.filelist { display: flex; flex-direction: column; gap: 8px; }
.fileitem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    background: rgba(11, 7, 4, .45);
    flex-wrap: wrap;
}
.fileitem .fname { font-family: var(--mono); font-size: 14px; color: var(--flame); }
.code {
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--r);
    border: 1px solid var(--line-soft);
    background: #0b0704;
    color: #f0dfd0;
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
}
.editor {
    font-family: var(--mono) !important;
    font-size: 13.5px !important;
    line-height: 1.6;
    min-height: 340px;
    background: #0b0704 !important;
    tab-size: 4;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* ---------------- rendered user markup ---------------- */
.markup { color: var(--text-dim); word-break: break-word; }
.markup > *:first-child { margin-top: 0; }
.markup > *:last-child  { margin-bottom: 0; }
.markup p { margin: 0 0 .85em; }
.markup strong { color: var(--text); font-weight: 700; }
.markup em { color: var(--text); font-style: italic; }

.markup .mk-h {
    font-family: "Orbitron", sans-serif;
    color: var(--text);
    margin: 1.2em 0 .5em;
    letter-spacing: .03em;
}
.markup h3.mk-h { font-size: 17px; }
.markup h4.mk-h { font-size: 15px; }
.markup h5.mk-h { font-size: 13.5px; color: var(--text-dim); }

.markup .mk-list { margin: 0 0 .85em; padding-left: 22px; }
.markup .mk-list li { margin-bottom: .3em; }

.markup .mk-quote {
    margin: 0 0 .85em;
    padding: 6px 14px;
    border-left: 3px solid var(--gold);
    background: rgba(255, 176, 39, .07);
    border-radius: 0 var(--r) var(--r) 0;
    color: var(--text-dim);
}

.markup .mk-hr {
    border: none;
    border-top: 1px solid var(--line-soft);
    margin: 1.3em 0;
}

.markup code {
    font-family: var(--mono);
    font-size: .9em;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255, 122, 24, .09);
    color: #ffc48a;
}
.markup .mk-code {
    margin: 0 0 .85em;
    white-space: pre;
    max-height: 380px;
}
.markup .mk-code code { background: none; padding: 0; color: inherit; }

/* Images: never wider than the panel, click to open full size. */
.markup .mk-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: .6em 0;
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    background: #0b0704;
    cursor: zoom-in;
}

/* Formatting cheatsheet under editors. */
.mk-help {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-mute);
}
.mk-help > summary { cursor: pointer; user-select: none; }
.mk-help > summary:hover { color: var(--flame); }
.mk-help ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.8; }
.mk-help code {
    font-family: var(--mono);
    background: rgba(255, 122, 24, .09);
    color: #ffc48a;
    padding: 1px 5px;
    border-radius: 4px;
}

/* Full-size image overlay. */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(3, 5, 10, .9);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--r);
    border: 1px solid var(--line);
    box-shadow: 0 0 60px rgba(255, 122, 24, .18);
}

/* ---------------- suggestions ---------------- */
.sugg-row { display: flex; gap: 14px; align-items: flex-start; }

.backer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 52px;
    padding: 7px 4px;
    border-radius: var(--r);
    border: 1px solid var(--line-soft);
    background: rgba(11, 7, 4, .5);
    color: var(--text-mute);
    font-family: var(--mono);
    cursor: pointer;
    transition: all .15s;
}
.backer:hover:not([disabled]) { border-color: var(--line); color: var(--text); }
.backer .arrow { font-size: 13px; line-height: 1; }
.backer .n { font-size: 16px; font-weight: 700; line-height: 1.2; }
.backer.active {
    color: var(--lime);
    border-color: var(--lime);
    background: rgba(124, 255, 90, .08);
    box-shadow: 0 0 14px rgba(124, 255, 90, .16);
}
.backer[disabled] { opacity: .45; cursor: not-allowed; }

.badge-new         { color: var(--flame); }
.badge-planned     { color: var(--gold); }
.badge-done        { color: var(--lime); }
.badge-declined    { color: var(--text-mute); }

/* ---------------- changelog timeline ---------------- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    padding-left: 22px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: linear-gradient(180deg, var(--flame), var(--gold), transparent);
    opacity: .5;
}
.release {
    position: relative;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-l);
    background: var(--panel);
    padding: 14px 16px;
}
.release::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 20px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--text-mute);
}
.release.latest { border-color: var(--line); }
.release.latest::before {
    border-color: var(--flame);
    box-shadow: 0 0 12px var(--flame);
}
.release-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.release-ver {
    font-family: "Orbitron", sans-serif;
    font-size: 16px;
    color: var(--flame);
    letter-spacing: .04em;
}
a.release-ver {
    border-bottom: 1px dashed rgba(255, 122, 24, .45);
    transition: text-shadow .15s, border-color .15s;
}
a.release-ver:hover {
    color: #ffa657;
    border-color: #ffa657;
    text-shadow: 0 0 12px rgba(255, 122, 24, .55);
}
.release-body {
    color: var(--text-dim);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 15px;
}

/* ---------------- collapsible file boxes ---------------- */
.filebox {
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    background: rgba(11, 7, 4, .45);
    overflow: hidden;
}
.filebox > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 11px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background .15s;
}
.filebox > summary::-webkit-details-marker { display: none; }
.filebox > summary:hover { background: rgba(255, 122, 24, .05); }
.filebox[open] > summary { border-bottom: 1px solid var(--line-soft); }

.filebox .chev {
    color: var(--text-mute);
    font-size: 12px;
    transition: transform .18s;
    display: inline-block;
}
.filebox[open] .chev { transform: rotate(90deg); color: var(--flame); }

.filebox .fname { color: var(--flame); font-size: 14px; }
.filebox .filemeta { font-size: 12.5px; }
.filebox .fileactions {
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* File reached from a changelog version link. */
.filebox.focused {
    border-color: var(--flame);
    box-shadow: 0 0 0 1px rgba(255, 122, 24, .18), 0 0 24px rgba(255, 122, 24, .12);
}
.filebox.focused > summary { background: rgba(255, 122, 24, .06); }

/* Even when open, never let one file eat the whole page. */
.filebox > .code {
    border: none;
    border-radius: 0;
    max-height: 460px;
    overflow: auto;
}

@media (max-width: 620px) {
    .filebox .filemeta { width: 100%; order: 3; }
    .filebox .fileactions { margin-left: 0; order: 4; }
}

/* ---------------- comments / threads ---------------- */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg {
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    background: rgba(11, 7, 4, .4);
    padding: 12px 15px;
}
.msg-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
    flex-wrap: wrap;
}
.msg-head .who { color: var(--ember); font-family: var(--mono); font-weight: 600; }
.msg-body { color: var(--text-dim); white-space: pre-wrap; word-break: break-word; }

/* ---------------- bug report replies ---------------- */
.replies { display: flex; flex-direction: column; gap: 8px; }
.replies:not(:empty) {
    margin: 12px 0 4px;
    padding-left: 14px;
    border-left: 2px solid var(--line-soft);
}
.reply {
    padding: 9px 12px;
    border-radius: var(--r);
    background: rgba(255, 255, 255, .022);
    border: 1px solid var(--line-soft);
}
/* A reply from the project author stands out - that's the official answer. */
.reply.from-dev {
    border-color: rgba(255, 122, 24, .3);
    background: rgba(255, 122, 24, .05);
}
.reply .msg-head { margin-bottom: 4px; font-size: 12.5px; }
.reply .markup { font-size: 14.5px; }

.js-bug-reply { margin-top: 10px; gap: 8px; }
.js-bug-reply textarea { min-height: 58px; font-size: 14.5px; }

/* ---------------- tables ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-soft);
}
.table th {
    font-family: "Orbitron", sans-serif;
    font-size: 11.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-mute);
}
.table tbody tr:hover { background: rgba(255, 122, 24, .04); }
.table-wrap { overflow-x: auto; }

/* ---------------- legal pages ---------------- */
.legal { max-width: 860px; }
.legal .panel { margin-bottom: 16px; }
.legal h2 {
    font-size: 17px;
    color: var(--text);
    margin-bottom: .7em;
}
.legal p { color: var(--text-dim); margin: 0 0 .9em; }
.legal p:last-child { margin-bottom: 0; }
.legal ul { color: var(--text-dim); margin: 0 0 .9em; padding-left: 22px; }
.legal li { margin-bottom: .4em; }
.legal b { color: var(--text); }
.legal a { text-decoration: underline; text-underline-offset: 2px; }

/* The summary box at the top gets accent bullets. */
.legal .tldr { list-style: none; padding-left: 0; }
.legal .tldr li {
    position: relative;
    padding-left: 24px;
    margin-bottom: .55em;
}
.legal .tldr li::before {
    content: "▸";
    position: absolute;
    left: 4px;
    color: var(--flame);
}

/* ---------------- misc ---------------- */
.empty {
    text-align: center;
    padding: 46px 20px;
    color: var(--text-mute);
    border: 1px dashed var(--line-soft);
    border-radius: var(--r-l);
}
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: var(--r);
    border: 1px solid var(--line-soft);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 14px;
}
.pagination .cur { border-color: var(--flame); color: var(--flame); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.split { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }

@media (max-width: 860px) {
    .split { grid-template-columns: 1fr; }
    .topbar-inner { padding: 10px 14px; }
    .nav { gap: 12px; font-size: 15px; }
    .container { padding: 20px 14px 44px; }
}

/* ---------------- scrollbars ---------------- */
* { scrollbar-color: rgba(255, 122, 24, .45) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(11, 7, 4, .5); }
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold), var(--flame) 55%, var(--ember));
    border-radius: 6px;
    border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--flame); }

/* Text selection picks up the brand orange too. */
::selection { background: rgba(255, 122, 24, .3); color: #fff; }

/* ---------------- nav: "coming soon" item ---------------- */
.nav-soon {
    color: var(--text-mute);
    letter-spacing: .03em;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-soon .soon {
    font-family: var(--mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    color: var(--gold);
}

/* Advertised in the nav but gated: clicking it lands on the sign-in page. */
.nav-locked {
    color: var(--text-mute);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.nav-locked:hover { color: var(--gold); }
.nav-locked .lock { font-size: 11px; opacity: .75; }

/* ---------------- server listing ---------------- */
.servers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.server {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-l);
    background: var(--panel);
    color: var(--text);
    overflow: hidden;
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.server:hover {
    transform: translateY(-3px);
    color: var(--text);
    border-color: var(--flame);
    box-shadow: 0 10px 30px rgba(255, 122, 24, .14);
}

/* Paid highlight slot. */
.server.featured {
    border-color: rgba(255, 182, 39, .45);
    background: linear-gradient(140deg, rgba(255, 182, 39, .07), var(--panel) 60%);
}
.server-flag {
    position: absolute;
    top: 0;
    right: 0;
    padding: 3px 10px;
    border-radius: 0 var(--r-l) 0 var(--r);
    background: linear-gradient(135deg, var(--gold), var(--flame));
    color: #1a0c02;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.server-logo {
    flex: 0 0 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r);
    background: #0b0704;
    border: 1px solid var(--line-soft);
    overflow: hidden;
}
.server-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.server-initial {
    font-family: "Orbitron", sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: var(--flame);
    opacity: .75;
}

.server-body { min-width: 0; flex: 1; }
.server-body h3 {
    margin: 0 0 3px;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.server-tag {
    margin: 0 0 7px;
    font-size: 14px;
    color: var(--text-dim);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.server-admin {
    position: absolute;
    bottom: 6px;
    right: 12px;
    font-size: 11px;
    color: var(--text-mute);
}

/* ---------------- projects: wall of logos ----------------
   Every tile is exactly the same box and the logo is scaled to fit inside
   it, so a 1200px banner and a 64px icon end up the same size on screen.
   Change these two values to resize the whole wall at once.            */
:root {
    --logo-w: 300px;
    --logo-h: 150px;
}

.logo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--logo-w), 1fr));
    gap: 18px;
}

.logo-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(var(--logo-h) + 28px);      /* box + padding */
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-l);
    background: var(--panel);
    overflow: hidden;
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.logo-tile:hover {
    transform: translateY(-3px);
    border-color: var(--flame);
    box-shadow: 0 10px 30px rgba(255, 122, 24, .14);
}
.logo-tile.featured {
    border-color: rgba(255, 182, 39, .45);
    background: linear-gradient(140deg, rgba(255, 182, 39, .07), var(--panel) 60%);
}
.logo-tile img {
    max-width: var(--logo-w);
    max-height: var(--logo-h);
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Used when a project has no logo yet. */
.logo-fallback {
    font-family: "Orbitron", sans-serif;
    font-size: 19px;
    font-weight: 700;
    text-align: center;
    color: var(--flame);
    opacity: .8;
}

/* ---------------- project page ---------------- */
.sp-head {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}
.sp-head-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--logo-w);
    height: var(--logo-h);
    border-radius: var(--r);
    background: #0b0704;
    border: 1px solid var(--line-soft);
    padding: 10px;
    overflow: hidden;
}
.sp-head-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.sp-head-body { flex: 1 1 260px; min-width: 0; }
.sp-head-body h1 { margin: 0 0 6px; }
.sp-tagline {
    margin: 0 0 14px;
    color: var(--text-dim);
    font-size: 16px;
}

/* Gallery of the server's systems. */
.shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.shot { margin: 0; }
.shot-link {
    display: block;
    cursor: zoom-in;
}
.shot img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--r);
    border: 1px solid var(--line-soft);
    background: #0b0704;
    transition: border-color .18s;
}
.shot-link:hover img { border-color: var(--flame); }
.shot figcaption {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-mute);
}

/* Screenshot rows inside the admin form. */
.shot-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}
.shot-admin-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.shot-admin-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: var(--r);
    border: 1px solid var(--line-soft);
    background: #0b0704;
}

.badge-srv-isro-r { color: var(--ember); }
.badge-srv-vsro   { color: var(--amber); }
.badge-srv-other  { color: var(--text-mute); }

/* Call-to-action panel at the bottom of the server list. */
.cta {
    border-color: rgba(255, 122, 24, .3);
    background: linear-gradient(140deg, rgba(255, 122, 24, .09), var(--panel) 55%);
}
.discord-tag {
    padding: 2px 9px;
    border-radius: 6px;
    background: rgba(88, 101, 242, .18);
    border: 1px solid rgba(88, 101, 242, .45);
    color: #b9c2ff;
}

input[type=file] {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--r);
    border: 1px dashed var(--line-soft);
    background: rgba(11, 7, 4, .5);
    color: var(--text-dim);
    font-family: "Rajdhani", sans-serif;
    font-size: 14.5px;
    cursor: pointer;
}
input[type=file]:hover { border-color: var(--flame); }

/* ---------------- binary attachments (downloads) ---------------- */
.asset {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    background: rgba(11, 7, 4, .45);
    transition: border-color .15s, box-shadow .15s;
}
.asset:hover {
    border-color: rgba(255, 122, 24, .4);
    box-shadow: 0 0 20px rgba(255, 122, 24, .08);
}
.asset-icon {
    flex: 0 0 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: var(--r);
    background: rgba(255, 122, 24, .1);
    border: 1px solid var(--line-soft);
}
.asset-body { flex: 1; min-width: 0; }
.asset-body .fname { color: var(--flame); font-size: 14.5px; }
.asset-body .filemeta { display: block; font-size: 12.5px; margin-top: 2px; }
.asset-notes {
    margin: 6px 0 0;
    font-size: 13.5px;
    color: var(--text-dim);
}

@media (max-width: 620px) {
    .asset { flex-wrap: wrap; }
    .asset-body { flex: 1 1 100%; order: 2; }
    .asset > .row { order: 3; width: 100%; }
}

/* Attachment reached from a changelog version link. */
.asset.focused {
    border-color: var(--flame);
    background: rgba(255, 122, 24, .07);
    box-shadow: 0 0 0 1px rgba(255, 122, 24, .18), 0 0 24px rgba(255, 122, 24, .12);
}
