:root {
  color-scheme: dark;
  --bg: #071016;
  --surface: #0c1820;
  --surface-2: #101f29;
  --line: #20343e;
  --line-bright: #34505d;
  --text: #edf4f1;
  --muted: #8fa4aa;
  --gold: #d7a84d;
  --gold-bright: #f1c86f;
  --green: #69d39d;
  --red: #ee7b75;
  --blue: #6bb8d6;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 18% -10%, #163241 0, transparent 32rem), var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .12; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"); }
.shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 38px; position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark { width: 46px; height: 46px; border: 1px solid #896b31; background: #191b17; color: var(--gold-bright); display: grid; place-items: center; font-size: 1.45rem; transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 500; letter-spacing: -.02em; }
h2 { margin: 4px 0 0; font-size: 1.15rem; font-weight: 650; }
.eyebrow, .label { color: var(--gold); font-size: .74rem; letter-spacing: .16em; font-weight: 750; margin-bottom: 5px; }
.refresh-block { color: var(--muted); display: flex; gap: 10px; align-items: center; font-size: .82rem; }
.icon-button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-bright); background: transparent; cursor: pointer; font-size: 1.2rem; }
.icon-button:hover { border-color: var(--gold); color: var(--gold-bright); }
.panel { background: linear-gradient(145deg, rgba(16,31,41,.96), rgba(10,22,29,.96)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; margin: 18px 0 14px; }
.hero-grid .panel { padding: 22px; min-height: 168px; }
.status-heading, .section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.status-line { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; }
.startup-message { color: var(--gold-bright); font-size: .8rem; line-height: 1.45; margin: 9px 0 0 20px; max-width: 34rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 5px rgba(143,164,170,.1); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 5px rgba(105,211,157,.1), 0 0 24px rgba(105,211,157,.35); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 5px rgba(238,123,117,.1); }
.pill { color: var(--muted); border: 1px solid var(--line); padding: 6px 9px; border-radius: 999px; font-size: .78rem; }
.server-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 23px; }
.server-stats div { border-left: 1px solid var(--line); padding-left: 12px; }
.server-stats div:first-child { border-left: 0; padding-left: 0; }
.server-stats span { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 5px; }
.server-stats strong { font-size: .96rem; font-weight: 600; }
.maintenance-inline { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.maintenance-inline .label { margin-bottom: 4px; }
.maintenance-inline .action-row { flex: 0 0 auto; margin: 0; }
.join-card { position: relative; overflow: hidden; }
.join-card::after { content: "ᛉ"; position: absolute; right: -12px; bottom: -46px; color: rgba(215,168,77,.06); font-size: 10rem; font-family: Georgia, serif; }
.join-code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 14px; position: relative; z-index: 1; }
.join-code-row strong { font-size: clamp(1.75rem, 3.2vw, 2.5rem); letter-spacing: .13em; font-variant-numeric: tabular-nums; }
.server-address-row { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); position: relative; z-index: 1; }
.server-address-row span, .server-address-row small { display: block; color: var(--muted); font-size: .67rem; }
.server-address-row strong { display: block; margin: 3px 0; font-family: "Cascadia Mono", Consolas, monospace; font-size: .8rem; }
.connection-details { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; min-width: 0; }
.connection-details strong { overflow-wrap: anywhere; }
.address-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.launch-button { border: 1px solid var(--gold); border-radius: 4px; background: rgba(215,168,77,.1); color: var(--gold-bright); padding: 7px 9px; text-decoration: none; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.launch-button:hover { background: rgba(215,168,77,.18); }
.launch-note { color: var(--blue); font-size: .7rem; line-height: 1.4; margin: 0 0 7px; }
.launch-guide { margin: 8px 0 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px; background: rgba(8,18,25,.5); font-size: .73rem; color: var(--muted); position: relative; z-index: 1; }
.launch-guide summary { color: var(--gold-bright); cursor: pointer; font-weight: 650; }
.launch-guide ol { margin: 9px 0 7px; padding-left: 20px; line-height: 1.55; }
.launch-guide p { margin: 0; line-height: 1.45; }
.launch-guide strong { color: var(--text); }
.copy-button, .text-button { border: 0; background: transparent; color: var(--gold-bright); cursor: pointer; padding: 7px; }
.muted { color: var(--muted); font-size: .82rem; line-height: 1.5; margin-bottom: 0; }
.action-row { display: flex; gap: 9px; margin: 19px 0 13px; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; padding: 0 16px; border-radius: 5px; border: 1px solid var(--line-bright); cursor: pointer; font-weight: 650; }
.primary-button { background: var(--gold); border-color: var(--gold); color: #13130d; }
.primary-button:hover { background: var(--gold-bright); }
.primary-button:disabled, .secondary-button:disabled { opacity: .42; cursor: not-allowed; border-color: var(--line); }
.secondary-button { background: transparent; }
.secondary-button:hover { border-color: var(--gold); }
.danger-button { background: #b94f4b; border-color: #d2645f; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.mods-panel, .health-panel, .notes-panel { padding: 22px; }
.heading-actions { display: flex; gap: 10px; align-items: center; }
.share-profile { display: grid; grid-template-columns: auto auto; align-items: center; gap: 4px 9px; margin-top: 12px; }
.share-profile > span { color: var(--muted); font-size: .74rem; }
.profile-code { border: 1px solid rgba(215,168,77,.35); border-radius: 4px; background: rgba(215,168,77,.08); color: var(--gold-bright); cursor: pointer; padding: 5px 8px; font-family: "Cascadia Mono", Consolas, monospace; font-size: .73rem; }
.profile-code:hover { border-color: var(--gold); background: rgba(215,168,77,.14); }
.share-profile small { grid-column: 1 / -1; color: var(--muted); font-size: .68rem; }
.update-summary { color: var(--muted); font-size: .8rem; }
.filter-row { display: flex; justify-content: space-between; gap: 12px; margin: 22px 0 14px; }
.search-field { flex: 1; max-width: 390px; }
.search-field input { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 4px; background: #081219; color: var(--text); padding: 0 13px; outline: none; }
.search-field input:focus { border-color: var(--gold); }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.segmented button { border: 0; border-left: 1px solid var(--line); background: transparent; padding: 0 13px; color: var(--muted); cursor: pointer; }
.segmented button:first-child { border-left: 0; }
.segmented button.active { background: #1c3038; color: var(--text); }
.table-wrap { overflow: auto; max-height: 600px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--muted); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 650; padding: 13px 10px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
td { border-top: 1px solid rgba(32,52,62,.65); padding: 13px 10px; font-size: .86rem; vertical-align: middle; }
td:first-child { min-width: 220px; }
.mod-name { display: block; font-weight: 650; }
.mod-author { display: block; color: var(--muted); font-size: .75rem; margin-top: 3px; }
.version { font-family: "Cascadia Mono", Consolas, monospace; color: #c9d5d4; font-size: .8rem; }
.badge { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; font-size: .72rem; border: 1px solid var(--line); color: var(--muted); }
.badge.current { color: var(--green); border-color: rgba(105,211,157,.3); }
.badge.update { color: var(--gold-bright); border-color: rgba(215,168,77,.38); background: rgba(215,168,77,.08); }
.badge.disabled { color: var(--red); border-color: rgba(238,123,117,.28); }
.badge.client { color: var(--blue); border-color: rgba(107,184,214,.35); background: rgba(107,184,214,.08); }
.empty-cell { color: var(--muted); text-align: center; padding: 40px; }
.side-column { display: grid; gap: 14px; }
.compact { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.issues-list { padding-top: 12px; }
.issue { padding: 11px 0; border-bottom: 1px solid rgba(32,52,62,.6); }
.issue:last-child { border-bottom: 0; }
.issue strong { display: block; color: var(--red); font-size: .78rem; margin-bottom: 4px; }
.issue span { color: #c4cfce; font-size: .78rem; line-height: 1.45; }
.healthy { display: flex; gap: 10px; align-items: center; color: var(--green); padding-top: 16px; }
.notes-panel ul { list-style: none; margin: 14px 0 0; padding: 0; }
.notes-panel li { padding: 12px 0; border-top: 1px solid var(--line); }
.notes-panel strong, .notes-panel span { display: block; }
.notes-panel strong { font-size: .87rem; margin-bottom: 4px; }
.notes-panel span { color: var(--muted); font-size: .78rem; line-height: 1.4; }
footer { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; padding: 18px 3px 0; }
dialog { width: min(460px, calc(100% - 30px)); color: var(--text); background: var(--surface-2); border: 1px solid var(--line-bright); border-radius: var(--radius); padding: 24px; box-shadow: 0 30px 100px #000; }
dialog::backdrop { background: rgba(2,8,12,.78); backdrop-filter: blur(3px); }
dialog h2 { font-size: 1.35rem; margin-bottom: 10px; }
dialog p:not(.label) { color: var(--muted); line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; transform: translateY(30px); opacity: 0; pointer-events: none; transition: .25s ease; padding: 13px 16px; border-radius: 5px; background: #182a32; border: 1px solid var(--line-bright); box-shadow: 0 18px 50px #0008; font-size: .85rem; }
.toast.show { transform: translateY(0); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.login-page { display: grid; place-items: center; }
.login-shell { width: min(430px, calc(100% - 28px)); position: relative; }
.login-layout { width: min(1080px, calc(100% - 28px)); display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 14px; align-items: start; padding: 28px 0; }
.login-card { padding: 30px; }
.login-brand { margin-bottom: 28px; }
.login-copy { color: var(--muted); line-height: 1.55; margin-bottom: 22px; }
.login-card label { display: block; color: var(--muted); font-size: .76rem; margin: 15px 0 7px; }
.login-card input { width: 100%; min-height: 44px; border: 1px solid var(--line-bright); border-radius: 5px; background: #081219; color: var(--text); padding: 0 13px; outline: none; }
.login-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(215,168,77,.1); }
.login-button { width: 100%; margin-top: 20px; }
.login-error { color: var(--red); font-size: .8rem; margin: 12px 0 -6px; }
.login-footnote { color: var(--muted); font-size: .7rem; line-height: 1.45; margin: 18px 0 0; text-align: center; }
.public-info { padding: 26px; min-width: 0; }
.public-server-heading, .public-mod-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.public-connect-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin: 22px 0; }
.public-connect-grid div { border: 1px solid var(--line); border-radius: 5px; padding: 12px; min-width: 0; }
.public-connect-grid span, .public-profile > span { display: block; color: var(--muted); font-size: .7rem; margin-bottom: 6px; }
.public-connect-grid strong { display: block; overflow-wrap: anywhere; font-family: "Cascadia Mono", Consolas, monospace; font-size: .84rem; }
.public-profile { padding: 12px; margin-bottom: 22px; border: 1px solid rgba(215,168,77,.25); border-radius: 5px; background: rgba(215,168,77,.05); }
.public-profile small { color: var(--muted); font-size: .68rem; margin-left: 8px; }
.public-mod-heading { align-items: center; padding-bottom: 9px; }
.public-mod-heading p { margin: 0; }
.public-mod-heading span { color: var(--muted); font-size: .76rem; }
.public-mod-list { max-height: 380px; overflow: auto; border-top: 1px solid var(--line); }
.public-mod-list > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 4px; border-bottom: 1px solid rgba(32,52,62,.6); }
.public-mod-list strong, .public-mod-list small { display: block; }
.public-mod-list strong { font-size: .78rem; }
.public-mod-list small { color: var(--muted); font-size: .67rem; margin-top: 2px; }
.public-mod-list code { color: #c9d5d4; font-size: .72rem; }

@media (max-width: 1050px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 1480px); padding-top: 18px; }
  .topbar { align-items: flex-start; }
  .refresh-block span { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: 1fr; }
  .filter-row, .section-heading { flex-direction: column; }
  .search-field { max-width: none; }
  .segmented { min-height: 40px; }
  .segmented button { flex: 1; }
  .heading-actions { justify-content: space-between; width: 100%; }
  .action-row { flex-direction: column; }
  .maintenance-inline { align-items: stretch; flex-direction: column; }
  .server-stats { grid-template-columns: 1fr 1fr; }
  .server-stats div:nth-child(3) { display: none; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  .login-layout { grid-template-columns: 1fr; padding: 14px 0; }
  .public-connect-grid { grid-template-columns: 1fr; }
}
