:root {
  --pine: #19392f;
  --pine-dark: #122e26;
  --pine-mid: #28503e;
  --ink: #222e27;
  --muted: #56665b;
  --faint: #788277;
  --paper: #f5f5ef;
  --card: #fffef9;
  --line: #d8dcd0;
  --accent: #f1be72;
  --rust: #99462f;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  text-rendering: optimizeLegibility;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { text-wrap: balance; }
h1, .brand strong, .world-content h2, .world-title h2, .auth-panel h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { font-size: clamp(2.1rem, 3.4vw, 3.35rem); line-height: 1.07; letter-spacing: -.055em; }
h2 { font-size: 1.2rem; letter-spacing: -.027em; }
h3 { font-size: 1rem; letter-spacing: -.02em; }
p { line-height: 1.55; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #a76b27; outline-offset: 3px; }
h1:focus, main:focus { outline: none; }
::selection { background: #f3cd91; color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; top: -5rem; left: 1rem; padding: .65rem 1rem; z-index: 10; background: var(--card); border-radius: .4rem; }
.skip:focus { top: 1rem; }
.icon { width: 1.23rem; height: 1.23rem; display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.brand { display: flex; align-items: center; gap: .68rem; }
.brandmark { width: 2.4rem; height: 2.65rem; flex: none; }
.brand strong,.brand span { display: block; }
.brand strong { font-size: 1.43rem; letter-spacing: -.05em; line-height: 1.22; }
.brand span { font-size: .84rem; letter-spacing: .018em; }
.button,.icon-button,.text-button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: .52rem; border: none; text-decoration: none; }
.button { min-height: 2.7rem; border: 1px solid #bac5b8; background: var(--card); padding: .55rem .95rem; border-radius: .42rem; font-size: .92rem; font-weight: 650; line-height: 1.2; }
.button:hover { background: #edf1e8; border-color: #839581; }
.button.primary { background: var(--pine); border-color: var(--pine); color: #fffaf0; }
.button.primary:hover { background: #2c5040; }
.button.amber { background: var(--accent); color: #2d3526; border-color: var(--accent); }
.button.amber:hover { background: #f8cc90; }
.button.destructive { background: #934634; border-color: #934634; color: white; }
.button.destructive:hover { background: #783525; }
.button:disabled { color: #6a766e; background: #e9ece4; border-color: #d8ded3; }
.button.small { min-height: 2.25rem; padding: .45rem .7rem; font-size: .875rem; }
.button.small .icon { width: 1rem; height: 1rem; }
.button.full { width: 100%; }
.icon-button { background: transparent; width: 2.35rem; height: 2.35rem; border-radius: .4rem; padding: .42rem; color: var(--muted); flex: none; }
.icon-button:hover { background: #edf1e8; color: var(--pine); }
.icon-button.danger-icon:hover { background: #f6e8df; color: var(--rust); }
.text-button { background: none; padding: .32rem 0; color: #355f42; font-size: .92rem; font-weight: 650; }
.text-button:hover { text-decoration: underline; text-underline-offset: .2em; }
label { display: grid; gap: .4rem; font-size: .9rem; font-weight: 630; }
input:not([type="checkbox"]),select { width: 100%; border: 1px solid #bdc8bc; border-radius: .37rem; min-height: 2.75rem; background: #fffefa; color: var(--ink); padding: .55rem .72rem; font-size: 1rem; font-weight: 400; }
input::placeholder { color: #6d786d; }
.select-wrap { display: block; position: relative; }
.select-wrap select { appearance: none; padding-right: 2.3rem; }
.select-wrap .icon { position: absolute; right: .65rem; top: 50%; transform: translateY(-50%); pointer-events: none; width: 1rem; }
.form-error { font-size: .9rem; color: #963f2e; }
.form-error:empty { display: none; }
.loading-screen { padding: 3rem; color: var(--muted); }
.auth-layout { min-height: 100vh; padding: 0 clamp(1rem,5vw,5rem) 3rem; background: radial-gradient(ellipse at 17% 80%, #e9ecdd 0, transparent 55%), var(--paper); }
.auth-header { max-width: 78rem; margin: auto; padding: 1.5rem 0; border-bottom: 1px solid #d3d8ca; }
.auth-header .brand strong { color: var(--pine); }
.auth-header .brand span { color: var(--muted); }
.auth-header .brandmark { width: 2.1rem; }
.auth-frame { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 65rem; margin: clamp(3rem,9vh,7rem) auto 0; border: 1px solid #cbd3c6; border-radius: .8rem; overflow: hidden; background: var(--card); box-shadow: 0 1.4rem 3.2rem -2.6rem #31483e72; }
.auth-scene, .world-banner { isolation: isolate; position: relative; overflow: hidden; color: #fff8e8; background-color: var(--pine); }
.auth-scene::before, .world-banner::before { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 68% 50%, #385b47 0, transparent 65%), linear-gradient(120deg,#17372d,#234837); }
.auth-scene::after, .world-banner::after { content: ""; position: absolute; z-index: -1; inset: 0; background-image: radial-gradient(#b6c59d33 .8px, transparent .8px); background-size: 11px 11px; mask-image: linear-gradient(115deg,transparent,black); }
.auth-scene { display: flex; flex-direction: column; padding: clamp(1.7rem,3.4vw,3.05rem); }
.world-title { display: flex; align-items: center; gap: .85rem; }
.world-mark { display: grid; place-items: center; width: 3rem; height: 3rem; border: 1px solid #7a958268; color: var(--accent); border-radius: .44rem; }
.eyebrow { font-size: .82rem; font-weight: 650; color: #d5dfcc; }
.world-title h2 { margin-top: .13rem; font-size: clamp(1.45rem,2.7vw,2rem); letter-spacing: -.045em; }
.terrain { position: relative; min-width: 0; pointer-events: none; }
.world-art { display: block; width: 100%; height: 100%; }
.auth-scene .terrain { flex: 1; min-height: 15rem; margin: .25rem -1.6rem .5rem; }
.auth-scene .world-art { position: absolute; inset: 0; }
.auth-panel { padding: clamp(2rem,4.7vw,4.25rem); align-self: center; }
.section-mark { display: grid; place-items: center; border: 1px solid #cedac8; background: #eef1e8; width: 2.8rem; height: 2.8rem; color: var(--pine-mid); border-radius: .6rem; margin-bottom: 1rem; }
.auth-panel h1 { font-size: clamp(2.3rem,3.7vw,3.3rem); }
.lede,.section-intro,.hint { color: var(--muted); }
.lede { margin: .6rem 0 1.6rem; }
#auth-form { display: grid; gap: 1rem; }
#auth-form .button { margin-top: .3rem; }
#password-help { color: var(--muted); margin-top: -.7rem; }
.auth-toggle { margin-top: .85rem; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 15.2rem minmax(0,1fr); }
.sidebar { background: var(--pine); color: #eff1e4; display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; padding: 1.7rem 1.05rem .9rem; }
.sidebar-top { padding: .05rem .5rem 1.7rem; border-bottom: 1px solid #a5b8a32b; }
.sidebar .brand span { color: #c6d2c1; }
.sidebar nav { display: grid; gap: .32rem; padding-top: 1.55rem; }
.sidebar nav a { display: flex; align-items: center; gap: .75rem; padding: .8rem .83rem; text-decoration: none; color: #ccd8c9; font-size: .94rem; font-weight: 550; border-radius: .37rem; }
.sidebar nav a:hover,.sidebar .icon-button:hover { background: #284b3b; color: #fff7e2; }
.sidebar nav a[aria-current] { background: #365844; color: #fff8e9; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar nav a[aria-current] .icon { color: #efc37c; }
.profile { margin-top: auto; border-top: 1px solid #a5b8a32b; padding: 1rem .15rem .2rem; display: flex; align-items: center; gap: .65rem; }
.avatar { width: 2.35rem; height: 2.35rem; flex: none; display: grid; place-items: center; background: #4c6450; color: #ffe1a8; border-radius: .5rem; font-family: Georgia,serif; font-size: 1.15rem; }
.profile div { overflow: hidden; }
.profile strong,.profile div span { display: block; }
.profile strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile div span { font-size: .8rem; color: #c3cfc0; }
.profile .icon-button { margin-left: auto; color: #cfdbcb; }
.mobile-menu { display: none; }
.workspace { min-width: 0; }
.topbar { height: 4.6rem; padding: 0 clamp(1.2rem,3.9vw,4.8rem); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 1rem; }
.breadcrumb,.hostname { display: flex; align-items: center; gap: .62rem; font-size: .87rem; color: var(--muted); }
.breadcrumb b { font-weight: 580; color: var(--ink); }
.breadcrumb span { color: #98a18f; }
.hostname { font-family: ui-monospace,monospace; font-size: .84rem; }
.hostname .icon { width: 1rem; height: 1rem; }
.content { max-width: 87rem; padding: clamp(1.65rem,3.2vw,3.25rem) clamp(1.25rem,3.9vw,4.8rem) 3.5rem; margin: auto; }
.page-heading,.result-header,.dialog-heading,.catalog-heading,.catalog-actions,.column-title,.column-bar,.dialog-buttons,.release-mod { display: flex; align-items: center; gap: .75rem; }
.page-heading { justify-content: space-between; margin-bottom: 1.65rem; }
.world-banner { display: grid; grid-template-columns: minmax(13rem,1fr) minmax(14rem,1.05fr); border-radius: .72rem; min-height: 14.8rem; }
.world-content { padding: clamp(1.55rem,3vw,2.7rem); display: flex; align-items: start; justify-content: center; flex-direction: column; }
.world-content h2 { font-size: clamp(2rem,3.3vw,3.3rem); letter-spacing: -.055em; margin: .3rem 0 .7rem; overflow-wrap: anywhere; }
.world-content .button { margin-top: 1.1rem; }
.world-content .button .icon { width: 1rem; }
.world-banner .terrain { margin: .4rem .65rem .45rem -.8rem; }
.world-banner .world-art { position: absolute; inset: 0; }
.state { display: inline-flex; align-items: center; gap: .4rem; color: #edf2df; font-size: .9rem; }
.state i { width: .5rem; height: .5rem; border-radius: 100%; background: #b0bca3; }
.state.live i { background: #a6d68b; }
.inline-note { display: flex; align-items: flex-start; gap: .55rem; color: #4e6357; font-size: .91rem; margin: .85rem 0; }
.inline-note .icon { width: 1.05rem; margin-top: .1rem; }
.inline-note.warning { color: #925020; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .8rem; margin: 1.05rem 0 2.1rem; }
.stat,.quick-links a,.catalog-card,.filters,.library-column,.table-frame,.empty-frame { border: 1px solid var(--line); border-radius: .6rem; background: var(--card); }
.stat { padding: 1.15rem 1.25rem 1.2rem; }
.stat div { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .89rem; }
.stat .icon { width: 1.1rem; }
.stat strong { display: block; margin-top: .5rem; font: 500 clamp(1.5rem,2.4vw,2.05rem)/1.1 Georgia,serif; letter-spacing: -.05em; overflow-wrap: anywhere; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-top: .75rem; }
.quick-links a { display: flex; align-items: center; gap: .95rem; padding: 1.15rem; text-decoration: none; }
.quick-links a:hover { border-color: #9cac92; background: #f9fbf3; }
.tile-icon,.column-mark,.empty-icon { display: inline-grid; place-items: center; flex: none; color: var(--pine-mid); background: #e8eee0; border-radius: .46rem; width: 2.75rem; height: 2.75rem; }
.quick-links p { margin-top: .22rem; color: var(--muted); font-size: .88rem; }
.section-intro { margin: -.7rem 0 1.35rem; }
.filters { padding: 1.05rem 1.15rem 1.15rem; }
.search-row { display: flex; gap: .55rem; }
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 1.12rem; color: var(--muted); }
.search-box input { padding-left: 2.4rem; }
.filter-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .7rem; margin-top: .9rem; }
.filter-grid label { color: var(--muted); font-size: .86rem; }
.filter-grid select { font-size: .9rem; min-height: 2.5rem; }
.result-header { margin: 1.6rem 0 .85rem; justify-content: space-between; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(17.5rem,100%),1fr)); gap: .85rem; }
.catalog-card { display: flex; flex-direction: column; gap: .75rem; min-width: 0; padding: 1rem; }
.catalog-heading h3,.library-card strong,.release-mod h3 { overflow-wrap: anywhere; }
.catalog-heading h3 { font-size: 1.02rem; }
.catalog-heading .icon-button,.release-mod .icon-button { margin-left: auto; align-self: flex-start; }
.mod-image { display: grid; place-items: center; position: relative; overflow: hidden; width: 2.85rem; height: 2.85rem; flex: none; border-radius: .4rem; background: #e7eddf; color: #527353; }
.mod-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #e7eddf; }
.mod-summary { font-size: .91rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.catalog-actions { padding-top: .8rem; margin-top: auto; border-top: 1px solid var(--line); justify-content: space-between; }
.catalog-actions .button { margin-left: auto; }
.metric { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; color: var(--muted); }
.metric .icon { width: 1rem; }
.pagination { margin-top: 1rem; text-align: center; }
.library-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; align-items: start; }
.library-column { overflow: hidden; }
.column-title { padding: 1.05rem 1.05rem .7rem; }
.column-mark { width: 2.15rem; height: 2.15rem; }
.disabled .column-mark { background: #ecebe1; color: #70694c; }
.count,.tag { display: inline-flex; align-items: center; background: #eef0e7; color: #55634f; border-radius: 1rem; padding: .17rem .52rem; font-size: .82rem; font-weight: 650; }
.column-title .count { margin-left: auto; }
.column-bar { justify-content: space-between; padding: .3rem 1.05rem .87rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .87rem; }
.library-list { display: grid; gap: .5rem; padding: .75rem; background: #fafaf5; min-height: 10.3rem; }
.library-card { display: flex; gap: .15rem; align-items: center; padding: 0 .35rem 0 0; min-width: 0; border: 1px solid var(--line); border-radius: .45rem; background: var(--card); }
.library-card.selected { border-color: #6a896a; background: #eaf1e4; }
.library-select { display: flex; align-self: stretch; align-items: center; gap: .55rem; flex: 1; min-width: 0; padding: .65rem .3rem .65rem .65rem; cursor: pointer; }
.library-select input { width: 1rem; height: 1rem; flex: none; margin: 0; accent-color: var(--pine-mid); }
.library-select .mod-image { width: 2.2rem; height: 2.2rem; }
.library-select small { display: block; margin-top: .12rem; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.card-tools { display: flex; align-items: center; gap: 0; }
.card-tools .icon-button { width: 1.95rem; height: 2.3rem; }
.card-tools .icon { width: 1.05rem; }
.empty { padding: 2rem 1rem; text-align: center; align-self: center; }
.empty .empty-icon { width: 2.25rem; height: 2.25rem; margin-bottom: .65rem; }
.empty p { margin-top: .35rem; color: var(--muted); font-size: .9rem; }
.empty-frame .empty { padding: 2.6rem 1rem; }
.table-frame { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; text-align: left; }
thead { background: #eef1e7; color: var(--muted); font-size: .84rem; }
th,td { padding: .85rem .95rem; }
tbody tr+tr td { border-top: 1px solid var(--line); }
td:last-child { text-align: right; }
.tag.available { background: #dfead7; color: #355a38; }
dialog { color: var(--ink); width: min(29rem,calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.4rem; border: 1px solid #aabaac; border-radius: .7rem; background: var(--card); box-shadow: 0 1.3rem 4rem #10291a30; }
dialog::backdrop { background: #15271ccd; }
.dialog-heading { justify-content: space-between; margin-bottom: 1rem; }
.dialog-heading h2 { font-size: 1.7rem; font-family: Georgia,serif; font-weight: 500; letter-spacing: -.045em; }
.dialog-heading .icon-button { align-self: start; margin: -.22rem -.22rem 0 0; }
dialog p, dialog label, dialog .form-error { margin-bottom: .9rem; }
.dialog-buttons { justify-content: flex-end; flex-wrap: wrap; margin-top: 1.15rem; }
.release-mod { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.hint { font-size: .9rem; }
.key-value { font-family: ui-monospace, monospace; }
.busy { color: var(--muted); padding: 1.5rem .3rem; display: flex; gap: .65rem; align-items: center; font-size: .95rem; }
.spinner { border: 2px solid #c4cebf; border-top-color: #49764e; width: 1rem; height: 1rem; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
#notice { display: none; position: fixed; z-index: 4; right: 1.2rem; bottom: 1.2rem; max-width: min(29rem,calc(100% - 2.4rem)); padding: .88rem 1rem; border-radius: .45rem; background: var(--pine); color: #fff9ea; font-size: .92rem; box-shadow: 0 .4rem 1.5rem #172a192d; }
#notice.visible { display: flex; align-items: center; gap: .6rem; }
#notice.error { background: #803d30; }
@media (min-width: 100rem) { .shell { grid-template-columns: 16.5rem minmax(0,1fr); } }
@media (max-width: 70rem) {
  .shell { grid-template-columns: 12.7rem minmax(0,1fr); }
  .sidebar { padding-inline: .65rem; }
  .library-columns { gap: .65rem; }
  .library-select .mod-image { display: none; }
}
@media (max-width: 52rem) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: .7rem 1.15rem; }
  .sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0; border: 0; }
  .sidebar .brandmark { width: 1.85rem; height: 2.2rem; }
  .sidebar .brand strong { font-size: 1.2rem; }
  .sidebar .brand span { font-size: .77rem; }
  .mobile-menu { display: flex; color: #e5ebd9; }
  .sidebar nav, .sidebar .profile { display: none; }
  .sidebar.expanded nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sidebar.expanded .profile { display: flex; margin-top: .5rem; }
  .topbar { height: 3.25rem; }
  .auth-panel { padding: 2rem; }
}
@media (max-width: 38rem) {
  .auth-layout { padding: 0 .9rem 1.2rem; }
  .auth-header { padding: .7rem .25rem; }
  .auth-frame { margin: 1rem auto 0; grid-template-columns: 1fr; max-width: 28rem; }
  .auth-scene { min-height: 8.1rem; display: flex; flex-direction: row; align-items: center; padding: 1.15rem; }
  .world-mark { display: none; }
  .auth-scene .terrain { flex: 1; align-self: stretch; min-height: 6rem; margin: -.6rem -.8rem -.6rem .2rem; }
  .auth-panel { padding: 1.55rem; }
  .auth-panel .section-mark { display: none; }
  .world-title h2 { font-size: 1.4rem; }
  .hostname { font-size: .77rem; }
  .breadcrumb { font-size: .8rem; gap: .35rem; }
  .content { padding: 1.5rem 1rem 2.5rem; }
  .page-heading { align-items: start; flex-wrap: wrap; gap: .85rem; margin-bottom: 1.2rem; }
  .world-banner { grid-template-columns: minmax(0,1fr) minmax(6rem,.85fr); min-height: 12rem; }
  .world-content { padding: 1.2rem .35rem 1.2rem 1.2rem; }
  .world-content h2 { font-size: 1.75rem; }
  .world-banner .terrain { margin: -.5rem -.7rem 0 -.4rem; }
  .stats { gap: .4rem; margin: .85rem 0 1.65rem; }
  .stat { padding: .75rem .6rem; }
  .stat div { gap: .25rem; font-size: .82rem; }
  .stat div .icon { display: none; }
  .stat strong { font-size: 1.38rem; }
  .library-columns,.quick-links { grid-template-columns: 1fr; }
  .library-select .mod-image { display: grid; }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filters { padding: .8rem; }
  .table-frame td,.table-frame th { padding: .65rem .55rem; }
  .table-frame { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.more-filters { margin-top: .95rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.more-filters summary { cursor: pointer; color: #426049; font-size: .88rem; font-weight: 600; }
.more-filters > div { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .7rem; }
.more-filters input { font-size: .9rem; min-height: 2.5rem; }
