/* ===== RP Community — base styles. Theme colours come from /themes.css ===== */
:where(:root) { --bg: #0f1117; --panel: #181b24; --panel2: #1f2330; --line: #2a2f3d; --text: #e8eaf0; --muted: #9aa1b2; --accent: #5865f2; --accent2: #4752c4; --on-accent: #fff; --link: #9aa4ff;
  --ok: #3ba55d; --warn: #f0b232; --bad: #ed4245; --info: #3aa8e0; --radius: 14px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body > header, body > main, body > footer, body > .wrap, body > .announce { position: relative; z-index: 1; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 28px; margin: 0 0 14px; letter-spacing: -.3px; } h2 { font-size: 20px; margin: 26px 0 12px; } h3 { margin: 0 0 10px; font-size: 16px; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 24px; padding-bottom: 50px; min-height: 72vh; }
.announce { background: var(--accent); color: var(--on-accent); text-align: center; padding: 7px 14px; font-weight: 600; font-size: 14px; }

/* ---------- top bar ---------- */
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); white-space: nowrap; } .brand:hover { text-decoration: none; }
.logo { height: 36px; width: auto; border-radius: 8px; }
.logo-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); font-size: 13px; letter-spacing: .5px; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a { color: var(--muted); padding: 7px 11px; border-radius: 9px; font-weight: 600; font-size: 14.5px; }
.mainnav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
.mainnav a.on { color: var(--text); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.mainnav a.staff-link { color: var(--warn); }
.userbox { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; font-size: 18px; color: var(--text); }
.icon-btn:hover { background: var(--panel2); text-decoration: none; }
.icon-btn .pill { position: absolute; top: 1px; right: 0; font-size: 11px; padding: 0 5px; line-height: 17px; }
.pill { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; } .pill[hidden] { display: none; }
.menu { position: relative; } .menu summary { list-style: none; cursor: pointer; } .menu summary::-webkit-details-marker { display: none; }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-weight: 600; margin: 0 !important; }
.me:hover { background: var(--panel2); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 210px; box-shadow: 0 16px 40px rgba(0,0,0,.4); z-index: 30; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--panel2); text-decoration: none; }
.burger { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 9px; width: 40px; height: 38px; font-size: 18px; cursor: pointer; }

/* ---------- buttons, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 650; cursor: pointer; transition: background .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--accent2); text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn.sm { padding: 6px 12px; font-size: 13.5px; border-radius: 8px; } .btn.big { padding: 13px 26px; font-size: 16px; } .btn.full { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); } .btn.ghost:hover { background: var(--panel2); }
.btn.danger, .btn.ghost.danger { color: var(--bad); } .danger-btn { background: var(--bad) !important; color: #fff !important; }
button.link { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; } button.link.danger, .danger { color: var(--bad); }
input, select, textarea { width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; }
select.sm { width: auto; padding: 5px 8px; font-size: 13px; }
input[type=color] { padding: 2px; height: 40px; } input[type=file] { padding: 7px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
label { display: block; font-weight: 600; font-size: 14px; } label input, label select, label textarea { margin-top: 6px; font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; } label.check input { width: auto; margin: 0; }
label.locked, .bcheck.locked { opacity: .45; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.code-input { font-size: 24px; letter-spacing: 6px; text-align: center; }

/* ---------- layout helpers ---------- */
.card { background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; } .card.sub { background: var(--panel2); }
.stack > * + * { margin-top: 12px; } .stack > .card + .card { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .wrap-row { flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; } .cols > .card + .card { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .span2 { grid-column: span 2; }
.grow { flex: 1; min-width: 0; } .narrow { max-width: 520px; margin: 30px auto; } .center { text-align: center; }
.muted { color: var(--muted); } .small { font-size: 13px; } .pre { white-space: pre-wrap; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .bad-text { color: var(--bad); }
.big-icon { font-size: 48px; line-height: 1.1; } .empty { text-align: center; padding: 36px; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--panel); }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 13%, var(--panel)); }
.flash.bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); background: color-mix(in srgb, var(--bad) 13%, var(--panel)); }
.flash.info { border-color: color-mix(in srgb, var(--info) 50%, transparent); background: color-mix(in srgb, var(--info) 11%, var(--panel)); }
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; text-transform: capitalize; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); }
.table { width: 100%; border-collapse: collapse; } .table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; } .table tr:last-child td { border-bottom: 0; }
.table td.actions form { display: inline-flex; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; text-transform: capitalize; }
.chip:hover { color: var(--text); text-decoration: none; } .chip.on { color: var(--text); border-color: var(--dc, var(--accent)); background: color-mix(in srgb, var(--dc, var(--accent)) 18%, transparent); }
.chip b { background: var(--panel2); border-radius: 999px; padding: 0 6px; font-size: 12px; }
.tabs { margin-bottom: 14px; gap: 8px; } .pager { margin-top: 16px; }
details summary { cursor: pointer; }

/* role badges (the coloured tags) */
.rb { --bc: #5865f2; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: color-mix(in srgb, var(--bc) 55%, var(--text));
  background: color-mix(in srgb, var(--bc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--bc) 45%, transparent); vertical-align: middle; }
.rb.sm { font-size: 11px; padding: 1px 7px; }
.badge-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* avatars */
.av { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; vertical-align: middle; background: var(--panel2); }
.av-letter { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.av.ring { box-shadow: 0 0 0 5px var(--panel), 0 0 0 7px var(--accent); }
.av-wrap { position: relative; display: inline-block; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); } .dot.on { background: #22c55e; box-shadow: 0 0 0 2px var(--panel); }
.av-wrap .dot { position: absolute; right: 2px; bottom: 2px; width: 13px; height: 13px; } .av-wrap .dot.big { width: 20px; height: 20px; right: 8px; bottom: 8px; box-shadow: 0 0 0 4px var(--panel); }
.ulink { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; } .ulink:hover span { text-decoration: underline; }

/* ---------- auth ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 30px 0; } .auth-card { width: 100%; max-width: 440px; padding: 28px; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: 220px; margin: 0 auto; } .qr svg { display: block; width: 100%; }
.backup-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .backup-codes code { text-align: center; padding: 8px; font-size: 15px; }

/* ---------- home ---------- */
.hero { padding: 46px 0 30px; text-align: center; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -1.5px; margin-bottom: 10px; background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--accent) 70%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 auto; max-width: 640px; }
.hero-cta { justify-content: center; margin-top: 22px; }
.hero-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-stats div { background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 12px 22px; min-width: 130px; }
.hero-stats b { display: block; font-size: 26px; } .hero-stats span { color: var(--muted); font-size: 13px; }
.home-section { margin-top: 34px; } .home-section h2 { margin: 0 0 12px; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.dept-grid .card { margin: 0; }
.dept-card { display: flex; flex-direction: column; gap: 4px; color: var(--text); border-top: 3px solid var(--dc); transition: transform .15s, border-color .15s; }
.dept-card:hover { transform: translateY(-3px); text-decoration: none; border-color: var(--dc); }
.d-ic { font-size: 30px; line-height: 1; }
.train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; } .train-grid .card { margin: 0; }
.train-card { display: flex; gap: 14px; align-items: center; color: var(--text); } .train-card:hover { text-decoration: none; border-color: var(--accent); }
.cal-chip { width: 54px; text-align: center; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); flex-shrink: 0; }
.cal-chip span { display: block; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 0; }
.cal-chip b { display: block; font-size: 22px; padding: 2px 0; background: var(--panel2); }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-strip a { aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--panel2); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; } .photo-strip a:hover img { transform: scale(1.06); }

/* ---------- departments ---------- */
.dept-list { display: flex; flex-direction: column; gap: 12px; }
.dept { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--dc); border-radius: var(--radius); overflow: hidden; }
.dept summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 16px 20px; } .dept summary::-webkit-details-marker { display: none; }
.dept summary:hover { background: color-mix(in srgb, var(--dc) 8%, transparent); }
.dept summary b { font-size: 17px; } .d-sum { display: block; }
.chev { font-size: 18px; color: var(--muted); transition: transform .2s; } .dept[open] .chev { transform: rotate(180deg); }
.dept[open] summary { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--dc) 10%, transparent); }
.dept-body { padding: 20px; animation: dropin .25s ease; }
@keyframes dropin { from { opacity: 0; transform: translateY(-6px); } }
.req { margin: 0; padding-left: 18px; } .req li { margin: 4px 0; }
.dept-members { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- members & profiles ---------- */
.filters { margin-bottom: 16px; } .filters select { width: auto; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; } .member-grid .card { margin: 0; }
.member-grid.tight { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.member { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text); padding: 18px 12px; }
a.member:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); } .member { transition: transform .15s, border-color .15s; }
.mini-card { background: var(--panel2); border-radius: 12px; border: 1px solid var(--line); }
.profile-head { padding: 0; overflow: hidden; margin-bottom: 18px; }
.pbanner { height: 190px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 55%, var(--bg)), color-mix(in srgb, var(--info) 30%, var(--bg))); background-size: cover; background-position: center; }
.pmain { display: flex; align-items: flex-end; gap: 20px; padding: 0 24px 20px; margin-top: -54px; flex-wrap: wrap; }
.pinfo { padding-top: 60px; } .pinfo h1 { margin: 0 0 8px; } .pinfo p { margin: 8px 0 0; }
.callsign { font-size: 14px; font-weight: 700; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; vertical-align: middle; color: var(--muted); }
.pactions { padding-bottom: 4px; }
.profile-head.is-banned { filter: grayscale(.8); opacity: .8; }
.ban-banner { display: flex; gap: 16px; align-items: center; border: 1px solid color-mix(in srgb, var(--bad) 55%, transparent); background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--bad) 14%, var(--panel)) 0 18px, color-mix(in srgb, var(--bad) 8%, var(--panel)) 18px 36px); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; }
.ban-banner h2 { margin: 0 0 4px; color: var(--bad); } .ban-banner p { margin: 4px 0; }
.friend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.friend-grid a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); font-size: 12px; text-align: center; overflow: hidden; }
.friend-grid a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row { padding: 8px 0; border-bottom: 1px solid var(--line); } .list-row:last-child { border-bottom: 0; }
.banner-prev { width: 100%; border-radius: 10px; max-height: 120px; object-fit: cover; }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 380px; overflow-y: auto; padding: 2px; }
.tp { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 12.5px; cursor: pointer; padding: 6px; border-radius: 10px; border: 2px solid transparent; }
.tp input { position: absolute; opacity: 0; pointer-events: none; } .tp:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tp-sw { position: relative; height: 40px; border-radius: 8px; border: 1px solid var(--line); } .tp-sw i { position: absolute; right: 4px; top: 2px; font-style: normal; font-size: 13px; }

/* ---------- messages ---------- */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.chat-layout .card + .card { margin: 0; }
.convo-list { padding: 12px; max-height: 70vh; overflow-y: auto; }
.convo { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 10px; color: var(--text); } .convo:hover, .convo.on { background: var(--panel2); text-decoration: none; }
.convo .grow { display: flex; flex-direction: column; }
.chat { display: flex; flex-direction: column; height: 70vh; padding: 0; overflow: hidden; } .empty-chat { justify-content: center; align-items: center; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72%; align-self: flex-start; } .msg.mine { align-self: flex-end; text-align: right; }
.bubble { display: inline-block; text-align: left; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--panel2); border: 1px solid var(--line); word-wrap: break-word; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--accent); color: var(--on-accent); border-color: transparent; border-radius: 16px 16px 4px 16px; }
.when { font-size: 11px; color: var(--muted); margin-top: 2px; }
.chat-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; } .chat-form textarea { resize: none; }

/* ---------- notifications ---------- */
.notif-list { padding: 6px; }
.notif { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; color: var(--text); } .notif:hover { background: var(--panel2); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--accent) 10%, transparent); } .notif.unread .grow { font-weight: 650; }
.notif.unread::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.n-ic { font-size: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- calendar ---------- */
main.wide { max-width: 1200px; }
.cal-top h2 { margin: 0; } .dept-filter { margin: 12px 0; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-wd { text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 4px 0; }
.cal-cell { position: relative; min-height: 112px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-cell.blank { background: transparent; border-style: dashed; opacity: .35; }
.cal-cell.past { opacity: .55; } .cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.today .cal-day { background: var(--accent); color: var(--on-accent); }
.cal-day { font-weight: 800; font-size: 13px; color: var(--text); width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-add { position: absolute; top: 5px; right: 6px; width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); border: 1px dashed var(--line); opacity: 0; transition: opacity .15s; }
.cal-cell:hover .cal-add { opacity: 1; } .cal-add:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); text-decoration: none; }
.cal-ev { --dc: var(--accent); display: block; font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; color: var(--text); background: color-mix(in srgb, var(--dc) 24%, transparent); border-left: 3px solid var(--dc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev span { font-weight: 700; } .cal-ev:hover { text-decoration: none; filter: brightness(1.2); }
.cal-ev.mine { box-shadow: 0 0 0 1px var(--ok); } .cal-ev.mine::after { content: " ✓"; color: var(--ok); } .cal-ev.done { opacity: .6; }
.train-big { border-left: 4px solid var(--dc); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 16px 0; }
.facts div { background: var(--panel2); border-radius: 10px; padding: 10px 12px; } .facts > div > span { display: block; color: var(--muted); font-size: 12px; }
.recruit-box { border-color: color-mix(in srgb, #a3e635 50%, var(--line)); background: color-mix(in srgb, #a3e635 8%, var(--panel)); margin-bottom: 16px; }

/* ---------- applications & tickets ---------- */
.app-row, .ticket-row { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); } .app-row:last-child, .ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { text-decoration: none; background: var(--panel2); }
.note { margin-top: 4px; padding: 6px 9px; background: var(--panel2); border-radius: 8px; }
.answer { padding: 12px 0; border-bottom: 1px solid var(--line); } .answer .q { font-weight: 700; color: var(--muted); font-size: 13px; margin-bottom: 4px; } .answer:last-child { border-bottom: 0; }
.tmsg { padding: 12px; border-radius: 12px; background: var(--panel2); margin-top: 10px; } .tmsg.staff { background: color-mix(in srgb, var(--info) 10%, var(--panel2)); border-left: 3px solid var(--info); }
.tbody { margin-top: 8px; }

/* ---------- gallery ---------- */
.upload-card summary { font-weight: 700; color: var(--link); } .upload-card { margin-bottom: 14px; }
.gallery { columns: 3 280px; column-gap: 14px; margin-top: 14px; }
.g-item { display: block; break-inside: avoid; margin-bottom: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.g-item img { width: 100%; display: block; transition: transform .3s; } .g-item:hover img { transform: scale(1.03); } .g-item:hover { text-decoration: none; }
.g-item span { display: block; padding: 8px 12px; font-size: 14px; } .g-item em { font-style: normal; color: var(--bad); float: right; }
.photo-view img { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 10px; background: #000; display: block; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; } .mod-grid .card { margin: 0; }
.mod-photo img { width: 100%; height: 170px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; } .mod-photo form { margin-top: 8px; }

/* ---------- staff ---------- */
.side-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding-top: 24px; padding-bottom: 50px; min-height: 72vh; }
.side-main { min-width: 0; }
.sidebar nav { position: sticky; top: 84px; }
.side-mobile summary { display: none; }
.side-group { margin-bottom: 16px; } .side-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 0 0 6px 10px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-size: 14px; }
.sidebar a:hover { background: var(--panel2); text-decoration: none; } .sidebar a.on { background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 650; }
.sidebar .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; } .stats .card { margin: 0; }
.stat { color: var(--text); } .stat:hover { text-decoration: none; border-color: var(--accent); } .stat span { color: var(--muted); font-size: 13px; display: block; } .stat b { font-size: 28px; }
.perm-list { columns: 2 260px; padding-left: 0; list-style: none; margin: 0; } .perm-list li { padding: 3px 0; }
.badge-checks, .perm-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; } .perm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bcheck { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-weight: 400; }
.bcheck input { width: auto; margin: 0; } .bcheck:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel2)); }
.q-row { padding: 8px 0; border-bottom: 1px solid var(--line); } .q-row select { width: auto; }
.email-preview { width: 100%; height: 640px; border: 0; border-radius: 12px; background: #fff; }
/* theme picker */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }
.theme-card { position: relative; overflow: hidden; background: var(--bg); color: var(--text); border: 2px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; isolation: isolate; }
.theme-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.theme-card[data-fx]:not([data-fx=""])::after { content: "✨ animated"; position: absolute; top: 4px; right: 8px; font-size: 10.5px; color: var(--muted); }
.tc-bar { height: 24px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 5px; padding: 0 10px; }
.tc-bar i { width: 30px; height: 6px; border-radius: 3px; background: var(--muted); opacity: .5; } .tc-bar i:first-child { background: var(--accent); opacity: 1; width: 40px; }
.tc-body { padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: radial-gradient(circle at 20% 0%, var(--fx1), transparent 70%), radial-gradient(circle at 90% 100%, var(--fx2), transparent 70%); }
.tc-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.tc-img { height: 30px; border-radius: 5px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 40%, var(--panel2)), var(--panel2)); margin-bottom: 6px; }
.tc-line { height: 5px; border-radius: 3px; background: var(--muted); opacity: .45; margin-bottom: 6px; width: 80%; } .tc-btn { height: 12px; border-radius: 4px; background: var(--accent); width: 60%; }
.tc-foot { padding: 10px 12px 12px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tc-foot b { display: block; font-size: 14px; } .tc-foot span { font-size: 12px; color: var(--muted); }

.foot { color: var(--muted); font-size: 13px; padding: 22px 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; } .foot-links a { color: var(--muted); }

/* ---------- phones & tablets ---------- */
@media (max-width: 1000px) {
  .burger { display: inline-flex; align-items: center; justify-content: center; order: 3; }
  .mainnav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; }
  body.nav-open .mainnav { display: flex; }
  .me-name { display: none; } .me { padding: 3px; }
}
@media (max-width: 860px) {
  .cols, .form-grid, .chat-layout, .side-layout { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .table { display: block; overflow-x: auto; }
  .side-mobile summary { display: block; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-weight: 700; }
  .side-mobile[open] summary { margin-bottom: 10px; } .sidebar nav { position: static; }
  .side-layout { padding-top: 14px; gap: 14px; }
  .cal-grid { gap: 3px; } .cal-cell { min-height: 74px; padding: 3px; } .cal-ev { font-size: 10px; padding: 2px 3px; } .cal-ev span { display: none; } .cal-add { opacity: 1; width: 18px; height: 18px; font-size: 12px; }
  .chat { height: 64vh; } .convo-list { max-height: 30vh; } .pmain { margin-top: -40px; } .pinfo { padding-top: 0; }
  .brand > span:last-child { display: none; }
}
#add, [id^="dept-"] { scroll-margin-top: 84px; }

/* ---------- community calendar ---------- */
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.seg a:hover { color: var(--text); text-decoration: none; } .seg a.on { background: var(--accent); color: var(--on-accent); }
.seg.full { display: flex; } .seg.full a { flex: 1; text-align: center; }
.cal-top .row h2 { min-width: 190px; text-align: center; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cal-dots { display: none; gap: 3px; margin-top: auto; } .cal-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.cal-ev.event { background: color-mix(in srgb, var(--dc) 30%, transparent); }
.agenda { display: flex; flex-direction: column; gap: 10px; }
.ag-day { display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: start; }
.ag-date { display: flex; flex-direction: column; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; color: var(--text); }
.ag-date:hover { text-decoration: none; border-color: var(--accent); } .ag-date b { font-size: 24px; line-height: 1.1; } .ag-date span { font-size: 12px; color: var(--muted); }
.ag-date em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 0 7px; margin-top: 4px; }
.ag-items { display: flex; flex-direction: column; gap: 6px; }
.ag-item { --dc: var(--accent); display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--dc); color: var(--text); }
.ag-item:hover { text-decoration: none; border-color: var(--dc); } .ag-item .grow { display: flex; flex-direction: column; } .ag-item.mine { box-shadow: inset 0 0 0 1px var(--ok); }
.ag-time { font-weight: 800; font-size: 13px; min-width: 70px; color: var(--muted); }
.addcal { position: relative; } .addcal summary { list-style: none; } .addcal summary::-webkit-details-marker { display: none; }
.addcal-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-width: 220px; z-index: 5; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.addcal-pop a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); } .addcal-pop a:hover { background: var(--panel2); text-decoration: none; }
.friend-grid.wide { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
#add-event, #add { scroll-margin-top: 84px; }
@media (max-width: 860px) {
  .cal-ev { display: none; } .cal-dots { display: flex; } .cal-cell { min-height: 58px; }
  .ag-day { grid-template-columns: 60px 1fr; gap: 8px; } .ag-time { min-width: 56px; }
  .cal-top .row h2 { min-width: 0; font-size: 17px; }
}

/* ---------- friendlier bits ---------- */
.checklist-card { margin-bottom: 18px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel)); }
.progress { height: 8px; border-radius: 999px; background: var(--panel2); overflow: hidden; margin: 12px 0 14px; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ok)); border-radius: 999px; transition: width .4s; }
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.gs { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); }
a.gs:hover { border-color: var(--accent); text-decoration: none; } .gs > span:last-child { display: flex; flex-direction: column; }
.gs-ic { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line); flex-shrink: 0; font-size: 15px; }
.gs.done { opacity: .6; } .gs.done .gs-ic { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 800; } .gs.done b { text-decoration: line-through; }
.tracker { margin-bottom: 18px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.steps::before { content: ""; position: absolute; top: 18px; left: 12.5%; right: 12.5%; height: 3px; background: var(--line); }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--muted); }
.dot2 { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--panel2); border: 2px solid var(--line); font-weight: 800; z-index: 1; }
.step.done { color: var(--text); } .step.done .dot2 { background: color-mix(in srgb, var(--ok) 25%, var(--panel)); border-color: var(--ok); }
.step.now { color: var(--text); font-weight: 700; } .step.now .dot2 { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); animation: pulse 1.8s ease-in-out infinite; }
.step.bad .dot2 { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 20%, var(--panel)); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent) 8%, transparent); } }
.how-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; } .how-steps .card { margin: 0; }
.how-step { position: relative; display: flex; flex-direction: column; gap: 4px; color: var(--text); } .how-step:hover { text-decoration: none; border-color: var(--accent); }
.how-n { position: absolute; top: 12px; right: 14px; font-weight: 900; font-size: 26px; color: color-mix(in srgb, var(--accent) 45%, transparent); }
.help-hero { text-align: center; max-width: 620px; margin: 10px auto 22px; } .help-hero input { font-size: 16px; padding: 12px 16px; margin-top: 6px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; } .help-grid .card { margin: 0; }
.faq { border-bottom: 1px solid var(--line); padding: 9px 0; } .faq:last-child { border-bottom: 0; }
.faq summary { color: var(--text); font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 800; } .faq[open] summary::after { content: "–"; } .faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 8px 0 2px; color: var(--muted); }
.flash { position: relative; padding-right: 40px; }
.flash-x { position: absolute; top: 8px; right: 8px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; } .flash-x:hover { background: var(--panel2); color: var(--text); }
.pw-wrap { position: relative; display: block; margin-top: 6px; } .pw-wrap input { margin-top: 0; padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 6px; opacity: .75; } .pw-eye:hover { opacity: 1; background: var(--panel); }
.btn.busy { opacity: .65; cursor: progress; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bottomnav { display: none; }
@media (max-width: 860px) {
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; border-radius: 10px; }
  .bottomnav a span { position: relative; font-size: 20px; line-height: 1.1; } .bottomnav a.on { color: var(--text); background: color-mix(in srgb, var(--accent) 15%, transparent); } .bottomnav a:hover { text-decoration: none; }
  .bottomnav em { position: absolute; top: -4px; right: -10px; font-style: normal; font-size: 10px; font-weight: 800; background: var(--bad); color: #fff; border-radius: 999px; padding: 0 5px; line-height: 15px; }
  body:has(.bottomnav) .foot { padding-bottom: 84px; }
  body:has(.bottomnav) .userbox .icon-btn { display: none; }
  .steps .small { font-size: 11px; } .dot2 { width: 32px; height: 32px; } .steps::before { top: 15px; }
}
@media (max-width: 860px) {
  .dept-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; } .dept-filter > * { flex-shrink: 0; }
  .ag-item { flex-wrap: wrap; gap: 2px 10px; } .ag-time { min-width: 0; width: 100%; }
  .cal-top { gap: 10px; }
}
.btn.discord { background: #5865f2; color: #fff; } .btn.discord:hover { background: #4752c4; }
.dc-logo { color: #5865f2; display: inline-flex; vertical-align: middle; } .dc-logo svg { width: 22px; height: 18px; }
.checklist { padding-left: 0; list-style: none; margin: 0; } .checklist li { padding: 4px 0; font-size: 14px; }

/* ---------- announcements, rules, notes, roster ---------- */
.news h2 { margin: 0; font-size: 21px; } .news h2 a { color: var(--text); } .news-by { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; }
.news.pinned, .news-mini.pinned { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; } .news-grid .card { margin: 0; }
.news-mini { display: flex; flex-direction: column; gap: 4px; color: var(--text); } .news-mini:hover { text-decoration: none; border-color: var(--accent); }
.prose p { margin: 0 0 10px; } .prose h3 { margin: 18px 0 8px; color: var(--accent); } .prose h3:first-child { margin-top: 0; } .prose ul { margin: 0 0 10px; padding-left: 20px; } .prose li { margin: 3px 0; }
.rules p { padding: 6px 0 6px 12px; border-left: 3px solid var(--line); margin: 0 0 6px; }
.agree-box { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.notes { display: flex; flex-direction: column; gap: 8px; }
.note-item { padding: 10px 12px; border-radius: 10px; background: var(--panel2); border-left: 3px solid var(--info); } .note-item.warning { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--panel2)); }
.roster-group { border-top: 3px solid var(--dc); } .roster-group h3 { margin-bottom: 4px; } .table.roster td.actions form { gap: 6px; }
.prank { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13.5px; } .prank a { color: var(--text); } .prank code { font-size: 12px; }
