:root {
  color-scheme: dark;
  --bg: #0e1315;
  --sidebar: #131a1d;
  --surface: #192125;
  --field: #101719;
  --line: #344043;
  --text: #f3f6f1;
  --muted: #a5b4ae;
  --accent: #c3ed81;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
code { color: #d7f0b6; overflow-wrap: anywhere; }

.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 12px; margin: 0 8px 36px; }
.brand-mark {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: #172313;
  font-size: 22px;
  font-weight: 900;
}
.logo strong { display: block; font-size: 14px; letter-spacing: .13em; }
.logo small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.sidebar-label, .eyebrow, .topbar, .preview-label {
  color: #a9bdb0;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
}
.sidebar-label { margin: 0 12px 12px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  color: #bfcbc4;
  font-size: 14px;
}
.nav-link span { flex: 0 0 22px; font-size: 19px; text-align: center; }
.nav-link:hover, .nav-link.active { background: #29372e; color: #e6f9d0; }
.sidebar-bottom { margin-top: auto; padding: 0 12px; }
.logout { padding: 10px 0; border: 0; background: none; color: var(--muted); font-size: 13px; }
.logout:hover { color: white; }

.content {
  width: min(100%, 1160px);
  min-width: 0;
  margin-inline: auto;
  padding: 0 clamp(18px, 3vw, 42px) 72px;
}
.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.topbar-pill {
  padding: 8px 12px;
  border-radius: 99px;
  background: #203126;
  color: #d2e9c3;
  letter-spacing: 0;
  white-space: nowrap;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #aee97e;
}
.hero { padding: 28px 0 22px; }
.hero .eyebrow { margin: 0 0 8px; }
.hero h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.04em; }
.hero > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.server-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 330px);
  align-items: end;
  gap: 20px;
  padding: 20px 22px;
  border: 1px solid #3b5040;
  border-radius: 15px;
  background: #1a2922;
}
.server-bar h2 { margin: 5px 0; font-size: 22px; overflow-wrap: anywhere; }
.server-bar p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.server-switch, .server-switch-row, .log-select { min-width: 0; }
.server-switch-row { display: flex; gap: 8px; }
.server-switch-row select { flex: 1; min-width: 0; }
.section-heading { padding: 28px 0 16px; scroll-margin-top: 12px; }
.section-heading h2 { margin: 6px 0; font-size: 26px; letter-spacing: -.025em; }
.section-heading p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.settings-panel[hidden] { display: none; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-heading > div { min-width: 0; }
.card-heading h3, .log-card h3 { margin: 0 0 4px; font-size: 17px; }
.card-heading p, .log-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.card-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #304030;
  color: var(--accent);
  font-weight: 750;
}
.card label, .server-switch label, .login-card label {
  display: block;
  margin-bottom: 8px;
  color: #dce9dc;
  font-size: 13px;
  font-weight: 650;
}
.card input:not([type=checkbox]), .card textarea, .card select,
.server-switch select, .login-card input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #435154;
  border-radius: 9px;
  outline: none;
  background: var(--field);
  color: var(--text);
}
.card input[type=file] { padding: 9px; font-size: 12px; }
.card textarea { resize: vertical; min-height: 106px; }
.card input:focus, .card textarea:focus, .card select:focus,
.server-switch select:focus, .login-card input:focus { border-color: var(--accent); }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.text-card, .log-card { margin-top: 16px; }
.text-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.form-fields > label:not(.switch-row) { margin-top: 16px; }
.form-fields > label:first-child { margin-top: 0; }
.optional { color: #9aa9a2; font-weight: 400; }
.preview-wrap {
  min-width: 0;
  padding: 16px;
  border: 1px solid #41524a;
  border-radius: 12px;
  background: #121c1d;
}
.preview-label { margin: 0 0 12px; }
.preview-wrap img { display: block; width: min(100%, 900px); height: auto; margin-inline: auto; border-radius: 8px; }
.preview-wrap > .hint { margin-bottom: 4px; }
.preview-full { display: inline-block; margin-top: 9px; color: var(--accent); font-size: 13px; }
.preview-full:hover { text-decoration: underline; }
.switch-row {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px !important;
  padding: 12px 14px;
  border: 1px solid #3a4b47;
  border-radius: 10px;
  line-height: 1.4;
  cursor: pointer;
}
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  position: relative;
  border-radius: 22px;
  background: #52615e;
}
.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform .2s;
}
.switch-row input:checked + .switch { background: #a5d971; }
.switch-row input:checked + .switch::before { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { outline: 2px solid white; outline-offset: 3px; }
.two-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.log-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 1fr); align-items: center; gap: 20px; }
.details-controls { margin-top: 18px; border: 1px solid #42524b; border-radius: 10px; }
.details-controls summary { padding: 12px 14px; color: #dcebdc; font-size: 13px; font-weight: 700; cursor: pointer; }
.details-controls[open] summary { border-bottom: 1px solid #42524b; }
.details-controls .banner-controls { margin: 12px 14px 16px; }
.banner-controls { padding: 0; border: 0; }
.banner-controls legend { padding: 0; color: var(--muted); font-size: 12px; }
.banner-controls > .switch-row { margin-top: 10px !important; }
.banner-editor { padding: 0 14px 15px; }
.banner-editor summary { margin: 0 -14px; }
.banner-editor label { margin-top: 14px; }
.banner-buttons { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.download-banner { display: inline-flex; margin-top: 16px; }
.save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 4px;
  color: var(--muted);
  font-size: 13px;
}
.save-bar strong { color: var(--text); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  text-align: center;
}
.button.primary { background: var(--accent); color: #1a2b16; }
.button.primary:hover { background: #d7faa2; }
.button.secondary { border-color: #506355; background: #29372e; color: #e6f4dd; }
.button.secondary:hover { background: #354b3d; }
.button.subtle { border-color: #50605a; background: transparent; color: #d5e3d9; }
.button.wide { width: 100%; justify-content: space-between; margin-top: 20px; }
.notice { margin: 16px 0; padding: 13px 16px; border-radius: 9px; font-size: 13px; }
.notice.success { border: 1px solid #4c7657; background: #213e2a; color: #d4f4d7; }
.notice.error { border: 1px solid #824a48; background: #4c292a; color: #ffcccc; }
.empty-state { margin-top: 20px; padding: 50px 24px; text-align: center; }
.empty-state .card-icon { margin: 0 auto 16px; }
.empty-state p { color: var(--muted); }
.empty-state a { color: var(--accent); }
footer { margin-top: 48px; color: #84958d; font-size: 11px; letter-spacing: .1em; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 25%, #263c2c, var(--bg) 65%);
}
.login-card {
  width: min(430px, calc(100% - 32px));
  padding: 34px;
  border: 1px solid #425447;
  border-radius: 18px;
  background: var(--surface);
}
.login-card .brand-mark { margin-bottom: 28px; }
.login-card h1 { margin: 9px 0; font-size: 29px; }
.login-card .muted, .footnote { color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-card label { margin-top: 24px; }
.footnote { margin: 22px 0 0; text-align: center; font-size: 11px; }

@media (max-width: 1200px) {
  .columns, .text-grid { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo { margin: 0 0 12px; }
  .sidebar-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .nav-link { flex: 0 0 auto; padding: 9px 12px; white-space: nowrap; }
  .content { padding: 0 18px 50px; }
}
@media (max-width: 620px) {
  .topbar { min-height: 54px; }
  .hero { padding: 22px 0 18px; }
  .server-bar, .log-card { grid-template-columns: 1fr; }
  .server-bar { padding: 18px; }
  .section-heading { padding-top: 24px; }
  .card { padding: 18px; }
  .save-bar .button { width: 100%; }
  .two-inputs { grid-template-columns: 1fr 1fr; }
}

/* LIMORY Discord OAuth + owner access list */
.oauth-button { display: block; text-align: center; margin-top: 24px; }
.access-action { margin-top: 20px; }
.access-users { display: grid; gap: 16px; }
.access-user { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
@media (max-width: 850px) {
  .sidebar-bottom { display: block; margin-top: 10px; }
}
