/* RedialBBS web front end. Dark by default (it's a BBS), light when the visitor prefers it. */
:root {
    --bg: #0d1117;
    --bg-2: #131a24;
    --card: #161e2b;
    --card-hover: #1c2738;
    --line: #263245;
    --text: #e6edf3;
    --muted: #8a99ab;
    --accent: #ffd86f;
    --accent-2: #7fdbff;
    --good: #9be564;
    --bad: #ff6b6b;
    --grad: linear-gradient(90deg, #ff512f, #dd2476 35%, #7b2ff7 70%, #4568dc);
    --radius: 12px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --mono: ui-monospace, "Cascadia Mono", "Consolas", "DejaVu Sans Mono", monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
    :root {
        --bg: #f4f6fa; --bg-2: #eaeef5; --card: #ffffff; --card-hover: #f2f5fb; --line: #d8dfea;
        --text: #18202b; --muted: #5d6b7c; --accent: #b7791f; --accent-2: #0b6e99; --good: #2f855a; --bad: #c53030;
        --shadow: 0 8px 24px rgba(20, 30, 50, .08);
    }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; display: flex; align-items: center; gap: .45em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; }
.icon { flex: none; vertical-align: -0.2em; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

/* Top bar */
.topbar {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
    padding: .6rem 1.2rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--grad); opacity: .8; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--grad); color: #fff; }
/* The network hub has its own colours (its icon: teal to ocean blue), so it is never mistaken for a board. */
.brand-mark.hub, .brand-name.hub { background: linear-gradient(135deg, #00c9a7, #0093a8 50%, #1d4e89); }
.brand-name.hub { -webkit-background-clip: text; background-clip: text; }
.brand-name { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.1rem; }
.nav { display: flex; gap: .2rem; flex: 1; flex-wrap: wrap; }
.nav-link {
    display: flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 9px; color: var(--muted);
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--card); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--card); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-link.admin { color: var(--accent); }
.me { display: flex; align-items: center; gap: .5rem; }
.me-chip { display: flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 99px; color: var(--text); }
.me-chip:hover { border-color: var(--accent); text-decoration: none; }
.badge { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 .35em; margin-left: .2em;
         border-radius: 99px; background: var(--good); color: #0d1117; font-size: .75rem; font-weight: 800; }

/* Buttons */
.button, button.button {
    display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--grad); color: #fff; font: 600 .95rem var(--sans); box-shadow: var(--shadow);
    transition: transform .12s, filter .12s;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.1); text-decoration: none; }
.button:active { transform: translateY(0); }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.button.ghost:hover { border-color: var(--accent); }
.button.danger { background: var(--bad); }
.button.big { padding: .75rem 1.3rem; font-size: 1.02rem; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px;
               background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s; }
.icon-button:hover { color: var(--bad); border-color: var(--bad); }
form.inline { display: inline; margin: 0; }

/* Layout */
.page { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; display: grid; gap: 1.2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 460px; width: 100%; margin: 1rem auto; }
.card.empty { text-align: center; display: grid; justify-items: center; gap: .3rem; padding: 3rem 1rem; color: var(--muted); }
.card.empty h1 { color: var(--text); }
.grid { display: grid; gap: 1rem; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile {
    position: relative; display: grid; gap: .3rem; padding: 1.3rem; border-radius: var(--radius); background: var(--card);
    border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s, background .15s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--card-hover); text-decoration: none; }
.tile .icon { color: var(--accent); }
.tile h2 { margin: .2rem 0 0; } .tile p { margin: 0; color: var(--muted); }
.tile .badge { position: absolute; top: 1rem; right: 1rem; }
.hero { text-align: center; padding: 1rem 0 0; }
.hero p { max-width: 640px; margin: 0 auto 1.2rem; }
.actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 0 2rem; }
.footer .sep { margin: 0 .5em; }

/* BBS markup rendered as HTML (banners, text blocks) */
.markup { white-space: pre-wrap; font: 15px/1.25 var(--mono); overflow-x: auto; }
.banner { padding: 1rem 1.2rem; background: #0b0f15; }
/* The welcome banner: the terminal's screen, as it is (no wrapping, rows touching so the big letters join up) */
.markup.welcome { white-space: pre; line-height: 1.12; width: fit-content; max-width: 100%; margin: 0 auto; font-size: 14px; }
@media (prefers-color-scheme: light) { .banner { background: #0d1117; color: #e6edf3; } }
.blink { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .blink { animation: none; } .tile, .button { transition: none; } }

/* Forms */
.form { display: grid; gap: .9rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
.form label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
.form label.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); margin: 0; }
input[type=text], input[type=password], input:not([type]), textarea, select {
    width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-2);
    color: var(--text); font: 1rem var(--sans); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 14rem; font-family: var(--mono); line-height: 1.4; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent); }
.alert, .success { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border-radius: 9px; margin: 0 0 1rem; }
.alert { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.success { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.4rem; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }

/* Lists and tables */
.list { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.row {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .7rem .9rem;
    border-radius: 10px; border: 1px solid transparent; color: var(--text); transition: background .12s, border-color .12s;
}
a.row:hover { background: var(--card-hover); border-color: var(--line); text-decoration: none; }
.row.unread { font-weight: 700; }
.row.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.row .meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; }
table.data tr:hover td { background: var(--card-hover); }
.chip { display: inline-block; padding: .05rem .5rem; border-radius: 99px; border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.chip.good { color: var(--good); border-color: var(--good); } .chip.warn { color: var(--accent); border-color: var(--accent); }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 1rem; }
.toolbar h1, .toolbar h2 { margin: 0; }

/* Messages */
.message-head { display: grid; gap: .2rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.message-head .topic { font-size: 1.35rem; font-weight: 700; }
.message-body { white-space: pre-wrap; font: 15px/1.5 var(--mono); overflow-wrap: anywhere; }
.message-body .quote { color: var(--muted); }
.thread { border-left: 2px solid var(--line); margin-left: .4rem; padding-left: .8rem; }

/* Live notices */
.notices { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; display: grid; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.notice {
    display: flex; gap: .6rem; align-items: center; padding: .8rem 1rem; border-radius: 12px; background: var(--card);
    border: 1px solid var(--good); box-shadow: var(--shadow); animation: slide-in .25s ease-out;
}
@keyframes slide-in { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 720px) {
    .nav-link span, .me-chip { display: none; }
    .topbar { gap: .5rem; padding: .5rem .7rem; }
    .row { grid-template-columns: auto 1fr; } .row .meta { grid-column: 2; }
}

/* Teleconference */
.tele { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.tele-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100vh - 9rem); min-height: 420px; padding: 1rem 1.2rem; }
.tele-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tele-head h1 { margin-bottom: .1rem; }
.tele-head p { margin: 0 0 .6rem; }
.tele-log {
    overflow-y: auto; background: #0b0f15; color: #e6edf3; border: 1px solid var(--line); border-radius: 10px;
    padding: .7rem .9rem; font-size: 14.5px; line-height: 1.45; scroll-behavior: smooth;
}
.tele-line { padding: .08rem 0; white-space: pre-wrap; overflow-wrap: anywhere; animation: tele-in .18s ease-out; }
.tele-line.end { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed #263245; }
@keyframes tele-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tele-input, .tele-ended { display: flex; gap: .6rem; margin-top: .8rem; }
.tele-input input { flex: 1; font: 15px var(--mono); }
.tele-side { display: grid; gap: 1rem; }
.tele-side .card { padding: 1rem; }
.tele-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.tele-list li { display: grid; padding: .35rem .55rem; border-radius: 8px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.tele-list li small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tele-list li.you span::after { content: " (you)"; color: var(--muted); font-size: .85em; }
.tele-list li.current { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 10%, transparent); }
.tele-list li[role=button] { cursor: pointer; }
.tele-list li[role=button]:hover, .tele-list li[role=button]:focus { background: var(--card-hover); border-color: var(--line); outline: none; }
.tele-tips p { margin: 0; color: var(--muted); line-height: 1.7; }
.tele-tips code { color: var(--accent); }
@media (max-width: 860px) {
    .tele { grid-template-columns: 1fr; }
    .tele-main { height: 70vh; }
    .tele-tips { display: none; }
}

/* File libraries */
.split-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.split-head h1 { margin: 0; }
.search { display: flex; gap: .5rem; align-items: center; flex-wrap: nowrap; flex: 1 1 360px; justify-content: flex-end; max-width: 620px; }
.search input { flex: 1; min-width: 0; width: auto; }
.search select, .search .button { width: auto; flex: none; }
table.files .chip { margin-left: .4rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; margin-top: 1rem; }
.tile {
    display: flex; gap: .9rem; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2);
    color: var(--text); transition: transform .15s, border-color .15s, background .15s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent-2); background: var(--card-hover); text-decoration: none; }
.tile-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; flex: none; color: #fff; background: var(--grad); }
.tile-body { display: grid; gap: .25rem; min-width: 0; }
.tile-body .meta { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.files td a b { word-break: break-word; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.prewrap { white-space: pre-wrap; }
.chip.bad { color: var(--bad, #ff6b6b); border-color: var(--bad, #ff6b6b); }
code.copy { display: block; font: 12.5px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; user-select: all;
            background: var(--card-hover); padding: .35rem .55rem; border-radius: 6px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem; margin-top: .8rem; }
.settings-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; transition: border-color .15s, background .15s; }
.settings-grid > div:hover { border-color: var(--accent); background: var(--card-hover); }
.settings-grid h3 { margin: 0 0 .35rem; font-size: .95rem; display: flex; gap: .4rem; align-items: center; }
.muted-on-button { opacity: .75; font-weight: 400; margin-left: .3rem; }
.drop {
    display: grid !important; justify-items: center; gap: .4rem; padding: 1.4rem; text-align: center; cursor: pointer;
    border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); transition: border-color .15s, background .15s;
}
.drop:hover, .drop:focus-within, .drop.over { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 6%, transparent); }
.drop input[type=file] { max-width: 100%; color: var(--text); }

/* Credits */
.balance { font: 700 1.7rem/1 var(--mono); padding: .3rem .8rem; border-radius: 10px; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.balance.debt { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
td.plus { color: var(--good); font-family: var(--mono); } td.minus { color: var(--bad); font-family: var(--mono); }
.inline-form { display: flex !important; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 160px; }

/* Polls and the registry */
.poll fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; margin: 0; display: grid; gap: .35rem; }
.poll legend { font-weight: 600; padding: 0 .3rem; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 200px) 1fr auto; gap: .8rem; align-items: center; margin: .25rem 0; }
.texts-area { padding-top: .7rem; padding-bottom: .7rem; }
.texts-area summary { cursor: pointer; font-size: 1.05rem; }
.texts-area summary .chip { margin-left: .5rem; }
.texts-topic { margin: 1rem 0 .3rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #8899aa); }
.texts-search input[name=q] { min-width: 18rem; }
.watch { overflow-x: auto; margin: .6rem 0; }
.watch pre { display: inline-block; margin: 0; padding: .6rem .8rem; background: #000; color: #aaa; border-radius: 8px; font: 14px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre; }
.bar { height: .7rem; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s ease-out; }
.lead { font-size: 1.1rem; }
textarea.short, .poll textarea { min-height: 4.5rem; font-family: var(--sans); }

/* ------------------------------------------------------------------------------------------------------------------
   The pages in the terminal's colours (0.25.46): each card's heading on the title bars' indigo, under the glowing
   band, in the same gold-to-pink letters; icons on tiles coloured along the welcome screen's sunset, as the menus'
   letters are; column headings on a bar; and a band to close each card. */
:root {
    --indigo: #1c1446;
    --title: linear-gradient(90deg, #ffd86f, #ff9e64 55%, #ff79c6);
    --t1: #ff512f; --t2: #ee3a52; --t3: #dd2476; --t4: #ac29b6; --t5: #7b2ff7; --t6: #4568dc;
}
.card { isolation: isolate; }
.card:not(.banner) { background: var(--grad) bottom / 100% 3px no-repeat, var(--card); }

/* The title bar: whatever row starts a card (a heading, or a heading with its buttons). */
.card > :is(h1, .toolbar, .split-head, .tele-head):first-child {
    position: relative; margin-top: -1.4rem; padding: 1.05rem 0 .9rem; margin-bottom: 1.1rem;
    /* the bar is dark in both themes, so what sits on it takes the dark theme's colours */
    --text: #e6edf3; --muted: #a9b4c8; --accent-2: #7fdbff; --line: #3a2f7a; --bg-2: #120d33; --card-hover: #261c5c;
    color: var(--text);
}
.card > :is(h1, .toolbar, .split-head, .tele-head):first-child::before {
    content: ""; position: absolute; z-index: -1; inset: 0 -1.4rem;
    background: var(--grad) top / 100% 3px no-repeat, var(--indigo);
    border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid #2b2164;
}
.tele-main > .tele-head:first-child { margin-top: -1rem; }
.tele-main > .tele-head:first-child::before { inset: 0 -1.2rem; }
.card:not(.empty) h1, .card:not(.empty) > h1:first-child {
    background: var(--title); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .02em;
}
.card:not(.empty) h1 .icon { color: #ff79c6; }
.card h2 .icon { color: #ff79c6; }
.card h2 { color: var(--accent); }

/* Column headings on a bar. */
table.data th { background: var(--indigo); color: #ffd86f; border-bottom-color: #2b2164; }
table.data th:first-child { border-radius: 8px 0 0 8px; } table.data th:last-child { border-radius: 0 8px 8px 0; }

/* Icons on tiles, coloured by their place along the sunset (as the menus colour their letters). */
.list .row > .icon:first-child, .tiles > .tile > .icon:first-child {
    box-sizing: content-box; padding: 6px; border-radius: 8px; color: #fff; background: var(--t1);
}
.tiles > .tile > .icon:first-child { padding: 9px; border-radius: 11px; }
.list > :nth-child(6n+2) .row > .icon:first-child, .tiles > .tile:nth-child(6n+2) > .icon:first-child { background: var(--t2); }
.list > :nth-child(6n+3) .row > .icon:first-child, .tiles > .tile:nth-child(6n+3) > .icon:first-child { background: var(--t3); }
.list > :nth-child(6n+4) .row > .icon:first-child, .tiles > .tile:nth-child(6n+4) > .icon:first-child { background: var(--t4); }
.list > :nth-child(6n+5) .row > .icon:first-child, .tiles > .tile:nth-child(6n+5) > .icon:first-child { background: var(--t5); }
.list > :nth-child(6n) .row > .icon:first-child, .tiles > .tile:nth-child(6n) > .icon:first-child { background: var(--t6); }
.nav > .nav-link:nth-child(6n+1) .icon { color: var(--t1); } .nav > .nav-link:nth-child(6n+2) .icon { color: var(--t2); }
.nav > .nav-link:nth-child(6n+3) .icon { color: var(--t3); } .nav > .nav-link:nth-child(6n+4) .icon { color: #d05ad8; }
.nav > .nav-link:nth-child(6n+5) .icon { color: #9a6bff; } .nav > .nav-link:nth-child(6n) .icon { color: #6b8cff; }
.nav > .nav-link.admin .icon { color: var(--accent); }

/* Something hidden stays hidden, whatever its layout says (the rooms' "Come back in" showed while the room was live). */
[hidden] { display: none !important; }

/* The Trivia room's screens are 80 columns wide, as on a terminal: the text shrinks to fit rather than wrapping the bars. */
#trivia .tele-log { container-type: inline-size; }
#trivia .tele-log .tele-line { font-size: clamp(8px, 2.02cqi, 14.5px); }
