:root {
  --bg: #f6f8f3; --surface: #ffffff; --surface2: #eef3e9; --text: #1d2a1a; --muted: #5d6b58; --line: #dbe4d3;
  --accent: #4f9d2d; --accent-ink: #ffffff; --accent-soft: #e2f2d8; --danger: #c0392b; --warn: #b7791f; --ok: #2f855a;
  --shadow: 0 1px 2px rgba(30,50,20,.06), 0 6px 18px -8px rgba(30,50,20,.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12170f; --surface: #1a2116; --surface2: #222b1d; --text: #e7efe1; --muted: #9db095; --line: #2c3826;
    --accent: #7ccf4d; --accent-ink: #0f1a09; --accent-soft: #263a1a; --danger: #ef6a5b; --warn: #e0a84a; --ok: #6fcf97;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -10px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12170f; --surface: #1a2116; --surface2: #222b1d; --text: #e7efe1; --muted: #9db095; --line: #2c3826;
  --accent: #7ccf4d; --accent-ink: #0f1a09; --accent-soft: #263a1a; --danger: #ef6a5b; --warn: #e0a84a; --ok: #6fcf97;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -10px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; margin: .2rem 0 .6rem; text-wrap: balance; } h2 { font-size: 1.15rem; margin: 0 0 .6rem; } h3 { margin: 0; font-size: 1.05rem; }
code { background: var(--surface2); padding: .1em .4em; border-radius: 6px; font-size: .88em; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .pad { padding: .6rem .8rem; }

.top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; padding: .7rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); } .brand:hover { text-decoration: none; } .leaf { margin-right: .2rem; }
.top-r { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg a { padding: .25rem .65rem; font-size: .8rem; font-weight: 700; color: var(--muted); } .seg a.on { background: var(--accent); color: var(--accent-ink); } .seg a:hover { text-decoration: none; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.inline { display: inline; margin: 0; }

.shell { max-width: 1120px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.shell.with-side { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.side { display: flex; flex-direction: column; gap: .2rem; position: sticky; top: 4.2rem; }
.side a { padding: .5rem .7rem; border-radius: 10px; color: var(--text); font-weight: 600; } .side a:hover { background: var(--surface2); text-decoration: none; }
.side a.on { background: var(--accent-soft); color: var(--accent); } .side a.muted { color: var(--muted); font-weight: 500; margin-top: .6rem; }
.guild-chip { display: flex !important; align-items: center; gap: .6rem; margin-bottom: .5rem; background: var(--surface); border: 1px solid var(--line); }
.guild-chip img, .ph { border-radius: 50%; } .ph { display: inline-grid; place-items: center; width: 36px; height: 36px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.guild-chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { min-width: 0; }

.btn { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); } .btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.sm { padding: .25rem .65rem; font-size: .82rem; } .btn.big { padding: .75rem 1.4rem; font-size: 1.02rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.hero { padding: 2.5rem 0 1.5rem; } .hero h1 { font-size: 2.3rem; max-width: 18ch; } .hero.small { padding: 3rem 0; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1rem; } .grid3 .card { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; } .grid2 .card { margin: 0; }
.stat { display: flex; flex-direction: column; } .num { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.srv-h { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; } .srv-h img { border-radius: 50%; }
.list { list-style: none; margin: 0; padding: 0; } .list li { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-top: 1px solid var(--line); } .list li:first-child { border-top: 0; }

.mod.is-off { opacity: .85; } .mod-h { display: flex; gap: .8rem; align-items: center; } .mod h3 a { color: var(--text); }
.mod-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); font-size: 1.4rem; } .mod-ic.big { width: 56px; height: 56px; font-size: 1.8rem; }
.mod-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; } .mod-top h1 { margin: 0; }
.crumb { margin: 0 0 .4rem; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 800; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }
.badge.on, .badge.st-active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.off, .badge.st-cancelled { background: transparent; color: var(--danger); border-color: var(--danger); }

.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .55rem 1rem; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; } .tabs a.on { color: var(--accent); border-color: var(--accent); } .tabs a:hover { text-decoration: none; }

.tbl-wrap { overflow-x: auto; } .tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: .5rem .6rem; }
.tbl td { padding: .7rem .6rem; border-top: 1px solid var(--line); vertical-align: top; } .tbl tr.sub td { border-top: 0; padding-top: 0; }
.acts { white-space: nowrap; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 1.4rem; margin-bottom: 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; } .field.wide, .row.wide { grid-column: 1 / -1; }
.lab { font-weight: 800; }
input[type=text], input[type=number], input[type=url], select, textarea { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; font: inherit; }
input[type=color] { width: 64px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; } .switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); } .switch input:checked + span::before { transform: translateX(20px); } .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.picker { position: relative; } .picker summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; background: var(--surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker summary::-webkit-details-marker { display: none; } .picker summary::after { content: "▾"; float: right; color: var(--muted); }
.picker-list { position: fixed; z-index: 50; min-width: 220px; max-height: 260px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: .3rem; }
.picker-list::-webkit-scrollbar { width: 8px; } .picker-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.picker-list .opt { min-width: 0; overflow-wrap: anywhere; }
.opt { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: 8px; cursor: pointer; } .opt:hover { background: var(--surface2); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

.flash { padding: .7rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.flash.ok { border-color: var(--ok); color: var(--ok); } .flash.warn { border-color: var(--warn); color: var(--warn); } .flash.error { border-color: var(--danger); color: var(--danger); }
summary.h2 { font-size: 1.15rem; font-weight: 800; cursor: pointer; margin-bottom: .6rem; }
.foot { text-align: center; color: var(--muted); padding: 1.5rem 1rem 2rem; font-size: .85rem; }

@media (max-width: 760px) {
  .shell.with-side { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; position: static; } .guild-chip { flex-basis: 100%; }
  .hero h1 { font-size: 1.8rem; }
}
