:root {
  color-scheme: dark;
  --ia-bg: #0a0a0b;
  --ia-surface: rgba(20, 20, 24, 0.9);
  --ia-surface-2: #1a1a1f;
  --ia-line: rgba(255, 255, 255, 0.08);
  --ia-line-2: rgba(255, 255, 255, 0.14);
  --ia-text: #f4f1ec;
  --ia-text-2: #c8c2b8;
  --ia-muted: #8a847a;
  --ia-accent: #e81c5a;
  --ia-accent-soft: rgba(232, 28, 90, 0.16);
  --ia-font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --ia-ease: cubic-bezier(0.16, 1, 0.3, 1);

  --lw-bg: var(--ia-bg);
  --lw-surface: var(--ia-surface);
  --lw-surface-2: var(--ia-surface-2);
  --lw-line: var(--ia-line);
  --lw-line-2: var(--ia-line-2);
  --lw-text: var(--ia-text);
  --lw-text-2: var(--ia-text-2);
  --lw-muted: var(--ia-muted);
  --lw-accent: var(--ia-accent);
  --lw-accent-soft: var(--ia-accent-soft);
  --lw-accent-glow: rgba(232, 28, 90, 0.35);
  --lw-warn: #f0c14d;
  --lw-display: var(--ia-font);
  --lw-sans: var(--ia-font);
  --lw-ease: var(--ia-ease);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: auto;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body.ia-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ia-font);
  color: var(--ia-text);
  background: var(--ia-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.45;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.ia-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--ia-bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 12% -10%, rgba(232, 28, 90, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 88% 8%, rgba(110, 180, 196, 0.1), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Ctext x='18' y='58' font-family='Arial Black,Arial,sans-serif' font-size='42' font-style='italic' font-weight='900' fill='%23ffffff' fill-opacity='0.04' transform='skewX(-12)'%3EIR%3C/text%3E%3Ctext x='88' y='118' font-family='Arial Black,Arial,sans-serif' font-size='42' font-style='italic' font-weight='900' fill='%23ffffff' fill-opacity='0.04' transform='skewX(-12)'%3EIR%3C/text%3E%3C/svg%3E");
  background-size: auto, auto, 140px 140px;
}

.ia-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 11, 0.96);
  border-bottom: 1px solid var(--ia-line);
}
.ia-top-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ia-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.ia-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--ia-accent-soft);
  color: var(--ia-accent);
  border: 1px solid rgba(232, 28, 90, 0.28);
  flex-shrink: 0;
  font-size: 1rem;
}
.ia-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.ia-brand-text strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.ia-brand-text em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ia-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ia-top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.ia-top-tools .ia-account,
.ia-top-tools .ia-menu,
.ia-top-tools .lw-menu,
.ia-top-tools .ia-search,
.ia-top-tools .lw-search {
  flex: 0 0 auto;
}

.ia-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--ia-line-2);
  background: transparent;
  color: var(--ia-text-2);
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background 0.2s var(--ia-ease), border-color 0.2s ease, color 0.2s ease;
}
.ia-btn:hover {
  color: var(--ia-text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}
.ia-btn--ghost { background: rgba(255, 255, 255, 0.03); }
.ia-btn--accent {
  background: var(--ia-accent);
  border-color: transparent;
  color: #fff;
}
.ia-btn--accent:hover {
  background: #f02966;
  color: #fff;
}
.ia-btn--logout {
  width: 36px;
  min-width: 36px;
  padding: 0;
}
.ia-btn--logout span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.ia-search.lw-search,
.lw-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 220px;
  width: 220px;
  max-width: 280px;
  min-width: 140px;
  height: 36px;
  margin: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--ia-line-2);
  background: rgba(255, 255, 255, 0.03);
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ia-search.lw-search:hover,
.ia-search.lw-search:focus-within,
.lw-search:focus-within {
  border-color: rgba(232, 28, 90, 0.45);
  background: rgba(255, 255, 255, 0.04);
}
.lw-search i { color: var(--ia-muted); font-size: 0.8rem; pointer-events: none; }
.lw-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--ia-text);
  font: inherit;
  font-size: 0.84rem;
}
.lw-search input::placeholder { color: var(--ia-muted); }

.lw-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--lw-line-2);
  background: var(--lw-surface-2);
  color: var(--lw-text);
  font-weight: 650;
  font-size: 0.88rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.lw-btn:hover { background: #222228; border-color: rgba(255, 255, 255, 0.2); }
.lw-btn:focus-visible { outline: 2px solid var(--lw-accent); outline-offset: 2px; }
.lw-btn--accent {
  background: var(--lw-accent);
  border-color: transparent;
  color: #fff;
}
.lw-btn--accent:hover { background: #f02966; }
.lw-btn--ghost { background: rgba(255, 255, 255, 0.03); }
.lw-btn--panel {
  background: linear-gradient(165deg, rgba(232, 28, 90, 0.22), rgba(232, 28, 90, 0.08));
  border-color: rgba(232, 28, 90, 0.45);
  color: #ffb3c9;
  box-shadow: 0 0 18px rgba(232, 28, 90, 0.12);
}
.lw-btn--panel:hover {
  background: linear-gradient(165deg, rgba(232, 28, 90, 0.38), rgba(232, 28, 90, 0.14));
  border-color: rgba(255, 90, 140, 0.7);
  color: #fff;
  box-shadow: 0 0 24px rgba(232, 28, 90, 0.28);
  transform: translateY(-1px);
}
.lw-btn--discord {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: 40px;
  padding: 0 16px 0 8px;
  gap: 10px;
  border: 1px solid rgba(232, 28, 90, 0.42);
  background: linear-gradient(165deg, rgba(40, 14, 24, 0.95) 0%, rgba(18, 12, 16, 0.98) 100%);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(232, 28, 90, 0.08) inset,
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(232, 28, 90, 0.18);
  transition:
    background 0.25s var(--lw-ease),
    border-color 0.25s var(--lw-ease),
    box-shadow 0.25s var(--lw-ease),
    transform 0.25s var(--lw-ease);
}
.lw-btn--discord::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.1) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.55s var(--lw-ease);
  pointer-events: none;
}
.lw-btn--discord::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -2;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(232, 28, 90, 0.55), transparent 55%, rgba(232, 28, 90, 0.25));
  opacity: 0.55;
  transition: opacity 0.25s var(--lw-ease);
  pointer-events: none;
}
.lw-btn--discord:hover {
  border-color: rgba(255, 90, 140, 0.7);
  background: linear-gradient(165deg, rgba(56, 16, 30, 0.98) 0%, rgba(22, 12, 18, 1) 100%);
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 120, 160, 0.12) inset,
    0 10px 28px rgba(0, 0, 0, 0.4),
    0 0 36px rgba(232, 28, 90, 0.38);
  transform: translateY(-1px);
}
.lw-btn--discord:hover::before { transform: translateX(120%); }
.lw-btn--discord:hover::after { opacity: 0.9; }
.lw-btn--discord:active {
  transform: translateY(0);
  box-shadow:
    0 0 0 1px rgba(232, 28, 90, 0.1) inset,
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 0 18px rgba(232, 28, 90, 0.25);
}
.lw-discord-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(232, 28, 90, 0.35), rgba(232, 28, 90, 0.12));
  border: 1px solid rgba(255, 143, 176, 0.28);
  color: #ffb3c9;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.25s var(--lw-ease), color 0.25s var(--lw-ease), box-shadow 0.25s var(--lw-ease);
}
.lw-btn--discord:hover .lw-discord-ico {
  background: linear-gradient(145deg, rgba(232, 28, 90, 0.55), rgba(232, 28, 90, 0.22));
  color: #fff;
  box-shadow: 0 0 14px rgba(232, 28, 90, 0.45);
}
.lw-discord-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  gap: 2px;
}
.lw-discord-text strong {
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.lw-discord-text em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 179, 201, 0.85);
}
.lw-btn[hidden],
#lwSaveBtn[hidden],
#ruSaveBtn[hidden] {
  display: none !important;
}
.lw-btn[aria-pressed="true"],
.lw-menu.is-open > .lw-btn,
.lw-menu.is-open > .ia-btn {
  background: var(--lw-accent-soft);
  border-color: rgba(232, 28, 90, 0.4);
  color: #ff8fb0;
}
.lw-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--lw-line);
  background: transparent;
  color: var(--lw-text-2);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.lw-icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--lw-text); }

.lw-menu { position: relative; }
.lw-menu-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 240px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--lw-line-2);
  background: #15151b;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  display: none;
  gap: 2px;
}
.lw-menu-drop.is-open { display: grid; }
.lw-menu-drop[hidden] { display: none !important; }
.lw-menu-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--lw-line);
}
.lw-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--lw-text);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  transition: background 0.15s ease;
}
.lw-menu-item i {
  width: 1em;
  color: var(--lw-muted);
}
.lw-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.lw-menu-item--danger { color: #fecaca; }
.lw-menu-item--danger i { color: #f87171; }
.lw-menu-item--accent { color: #ff8fb0; }
.lw-menu-item--accent i { color: var(--lw-accent); }
.lw-menu-item[hidden] { display: none !important; }

.ia-main.lw-main,
.lw-main {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.ia-hero.lw-hero,
.lw-hero {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.ia-eyebrow,
.lw-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ia-accent);
}
.ia-hero-title,
.lw-hero-title {
  margin: 0;
  font-family: var(--ia-font);
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.ia-hero-sub,
.lw-hero-sub {
  margin: 10px 0 0;
  max-width: 36rem;
  color: var(--ia-text-2);
  font-size: 0.95rem;
  line-height: 1.5;
}
.lw-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--ia-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ia-text-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.lw-meta i {
  color: var(--ia-accent);
  font-size: 0.85rem;
  opacity: 0.9;
}
.lw-meta-label {
  color: var(--ia-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lw-meta time {
  color: var(--ia-text);
  font-variant-numeric: tabular-nums;
}

.lw-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.lw-rail {
  position: sticky;
  top: 84px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--lw-line);
  background: #141418;
  contain: content;
  min-width: 0;
  max-height: calc(100vh - 100px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.lw-rail::-webkit-scrollbar { width: 5px; }
.lw-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}
.lw-rail-label {
  margin: 0 0 10px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lw-muted);
}
.lw-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lw-nav-group {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.lw-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--lw-text-2);
  font-weight: 650;
  font-size: 0.95rem;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.lw-tab > span {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.lw-tab > i:first-child { width: 1.1em; font-size: 0.9rem; opacity: 0.9; flex-shrink: 0; }
.lw-tab-count {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--lw-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  min-width: 1.4em;
  padding: 2px 7px;
  text-align: center;
  flex-shrink: 0;
}
.lw-tab-chevron {
  font-size: 0.68rem !important;
  opacity: 0.45;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}
.lw-nav-group.is-open .lw-tab-chevron {
  transform: rotate(180deg);
  opacity: 0.85;
}
.lw-tab.is-active .lw-tab-count {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.18);
}
.lw-tab:hover {
  color: var(--lw-text);
  background: rgba(255, 255, 255, 0.04);
}
.lw-tab.is-active {
  color: #fff;
  background: var(--lw-accent);
}
.lw-tab.is-active:hover {
  background: var(--lw-accent);
  color: #fff;
}
.lw-tab:focus-visible { outline: 2px solid var(--lw-accent); outline-offset: 2px; }

.lw-chapter-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 18px;
}
.lw-nav-group.is-open .lw-chapter-nav {
  display: flex;
}
.lw-chapter-nav-empty {
  margin: 0;
  padding: 6px 10px;
  color: var(--lw-muted);
  font-size: 0.82rem;
}
.lw-chapter-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--lw-text-2);
  text-align: left;
  cursor: pointer;
  transition: color 0.28s ease, background 0.28s ease;
}
.lw-chapter-link:hover {
  color: var(--lw-text);
  background: rgba(232, 28, 90, 0.08);
}
.lw-chapter-link.is-active {
  color: #ffb3c9;
  background: rgba(232, 28, 90, 0.14);
}
.lw-chapter-link-num {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.lw-chapter-link-name {
  font-size: 0.78rem;
  color: var(--lw-muted);
  line-height: 1.35;
}
.lw-chapter-link.is-active .lw-chapter-link-name {
  color: rgba(255, 179, 201, 0.75);
}
.lw-chapter {
  scroll-margin-top: 96px;
  min-width: 0;
}
.lw-chapter.is-active .lw-chapter-num {
  color: #ff6b9a;
}

.lw-panel {
  border: 1px solid var(--lw-line);
  border-radius: 18px;
  background: #141418;
  padding: 22px;
  min-height: 320px;
  width: 100%;
  contain: content;
}
.lw-articles {
  display: grid;
  gap: 28px;
}
.lw-chapter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  scroll-margin-top: 96px;
}
.lw-chapter-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  font-family: var(--lw-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  text-transform: none;
  color: var(--lw-text);
}
.lw-chapter-num {
  color: var(--lw-accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lw-chapter-name {
  color: rgba(244, 241, 236, 0.88);
  font-weight: 600;
}
.lw-chapter-empty {
  margin: 8px 4px 4px;
  color: var(--lw-muted);
  font-size: 0.88rem;
}
.lw-hint {
  margin: 0 0 12px;
  color: var(--lw-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.lw-hint strong {
  color: #e6dfd4;
  font-weight: 600;
}
.lw-chapter-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.lw-chapter-articles {
  display: grid;
  gap: 0;
}
.lw-article {
  position: relative;
  padding: 14px 4px 18px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  scroll-margin-top: 88px;
}
.lw-article.is-target {
  z-index: 2;
  border-radius: 12px;
  padding-left: 12px;
  padding-right: 12px;
  background: rgba(232, 28, 90, 0.12);
  box-shadow: inset 3px 0 0 #e81c5a;
  animation: lw-article-target 1.4s ease both;
}
.lw-article.is-target .lw-article-id {
  box-shadow: none;
}
@keyframes lw-article-target {
  0% {
    background: rgba(232, 28, 90, 0.22);
  }
  100% {
    background: transparent;
    box-shadow: inset 3px 0 0 transparent;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lw-article.is-target {
    animation: none;
    background: rgba(232, 28, 90, 0.14);
    box-shadow: inset 3px 0 0 #e81c5a;
  }
}
.lw-article:hover,
.lw-article:focus,
.lw-article:focus-within {
  background: transparent;
  outline: none;
  box-shadow: none;
  filter: none;
}
.lw-article.is-target:hover,
.lw-article.is-target:focus,
.lw-article.is-target:focus-within {
  background: rgba(232, 28, 90, 0.12);
  box-shadow: inset 3px 0 0 #e81c5a;
}
.lw-article:last-child {
  border-bottom-color: transparent;
}
.lw-article-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lw-article-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.lw-article-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  min-width: 2.4rem;
  height: 1.7rem;
  padding: 0 0.55rem;
  border-radius: 7px;
  background: var(--lw-accent-soft);
  color: var(--lw-accent);
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.lw-article-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--lw-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #f4f1ec;
}
.lw-article-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0.45;
}
.lw-article:hover .lw-article-tools,
.lw-article:focus-within .lw-article-tools,
body.is-editing .lw-article-tools {
  opacity: 1;
}
.lw-tool,
.lw-article-tools .lw-mini,
.lw-chapter-tools .lw-mini {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.lw-tool:hover,
.lw-article-tools .lw-mini:hover,
.lw-chapter-tools .lw-mini:hover {
  background: rgba(232, 28, 90, 0.12);
  color: #fff;
}
.lw-article-tools .lw-mini--danger:hover,
.lw-chapter-tools .lw-mini--danger:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}
.lw-article-text {
  margin: 8px 0 0 3.2rem;
  color: #9a948a;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.lw-article-penalty {
  margin: 10px 0 0 3.2rem;
  color: #c9b27a;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}
.lw-punishments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.lw-chip {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(240, 193, 77, 0.08);
  border: 1px solid rgba(240, 193, 77, 0.16);
  color: #d8d0c2;
  font-size: 0.84rem;
  line-height: 1.35;
}
.lw-chip strong {
  color: #f0c14d;
  font-weight: 700;
}
.lw-article mark,
.lw-search-hit mark {
  background: var(--lw-accent-soft);
  color: #ffb3c9;
  padding: 0 2px;
  border-radius: 3px;
}
.lw-search-results {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.lw-search-results[hidden] {
  display: none !important;
}
.lw-search-list {
  display: grid;
  gap: 6px;
}
.lw-search-empty {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
  color: var(--lw-muted);
  font-weight: 600;
}
.lw-search-hit {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1.6fr);
  gap: 10px 12px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--lw-line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--lw-text);
  text-align: left;
  cursor: pointer;
}
.lw-search-hit:hover {
  border-color: rgba(232, 28, 90, 0.3);
  background: transparent;
}
.lw-search-hit:focus-visible {
  outline: 2px solid var(--lw-accent);
  outline-offset: 2px;
}
.lw-search-hit-section {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--lw-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lw-search-hit-num {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ff8fb0;
  white-space: nowrap;
}
.lw-search-hit-title {
  font-weight: 650;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lw-print-all[hidden] {
  display: none !important;
}

.lw-mini {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--lw-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--lw-text-2);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}
.lw-mini:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--lw-text);
  border-color: var(--lw-line-2);
}
.lw-mini--copy:hover {
  border-color: rgba(232, 28, 90, 0.35);
  color: #ff8fb0;
  background: var(--lw-accent-soft);
}
.lw-mini--danger:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.3);
}

.lw-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--lw-muted);
}
.lw-empty i {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--lw-accent);
  opacity: 0.8;
}
.lw-empty p { margin: 0; font-weight: 600; }

.lw-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  z-index: 80;
  padding: 12px 18px;
  border-radius: 12px;
  background: #1c1c22;
  border: 1px solid var(--lw-line-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-weight: 650;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s var(--lw-ease);
  pointer-events: none;
}
.lw-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.lw-toast.is-ok { border-color: rgba(52, 211, 153, 0.35); color: #a7f3d0; }
.lw-toast.is-err { border-color: rgba(248, 113, 113, 0.35); color: #fecaca; }

.lw-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 28px);
  width: 760px;
}
.lw-dialog::backdrop {
  background: rgba(5, 5, 7, 0.78);
}
.lw-dialog-card {
  margin: 0;
  border-radius: 18px;
  border: 1px solid var(--lw-line-2);
  background: #15151a;
  overflow: hidden;
}
.lw-dialog-head,
.lw-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--lw-line);
}
.lw-dialog-foot {
  border-bottom: 0;
  border-top: 1px solid var(--lw-line);
  justify-content: flex-end;
}
.lw-dialog-head h3 {
  margin: 0;
  font-family: var(--lw-display);
  font-size: 1.35rem;
  font-weight: 700;
}
.lw-dialog-body {
  padding: 20px;
  display: grid;
  gap: 16px;
  max-height: min(70vh, 640px);
  overflow: auto;
}
.lw-field { display: grid; gap: 8px; }
.lw-field-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
}
.lw-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--lw-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lw-field input,
.lw-field textarea,
.lw-field select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--lw-line);
  background: #0f0f13;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease;
}
.lw-field input:focus,
.lw-field textarea:focus,
.lw-field select:focus {
  border-color: rgba(232, 28, 90, 0.45);
}
.lw-field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
.lw-icon-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.lw-icon-opt {
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--lw-line);
  background: #0f0f13;
  color: var(--lw-text-2);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.lw-icon-opt:hover {
  border-color: var(--lw-line-2);
  color: var(--lw-text);
}
.lw-icon-opt.is-active {
  border-color: rgba(232, 28, 90, 0.55);
  background: var(--lw-accent-soft);
  color: #ff8fb0;
}
.lw-punish-editor { display: grid; gap: 10px; }
.lw-punish-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 10px;
  align-items: center;
}
.lw-punish-row input {
  border-radius: 10px;
  border: 1px solid var(--lw-line);
  background: #0f0f13;
  padding: 12px 14px;
  outline: none;
  width: 100%;
}
.lw-punish-row input:focus {
  border-color: rgba(232, 28, 90, 0.45);
}
.lw-add-punish {
  justify-self: start;
}

body.is-editing .lw-panel {
  outline: 1px solid rgba(232, 28, 90, 0.22);
  outline-offset: -1px;
}

@media (max-width: 900px) {
  .lw-layout { grid-template-columns: 1fr; }
  .lw-rail {
    position: static;
    padding: 10px;
  }
  .lw-tabs {
    flex-direction: column;
    overflow: visible;
    gap: 8px;
  }
  .lw-tab {
    width: 100%;
    min-height: 44px;
    border-radius: 999px;
    border-color: var(--lw-line);
    background: rgba(255, 255, 255, 0.03);
  }
  .lw-tab.is-active {
    border-color: transparent;
    background: var(--lw-accent);
  }
  .lw-chapter-nav {
    margin-left: 12px;
    padding-left: 8px;
  }
  .lw-search-hit {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .lw-field-row { grid-template-columns: 1fr; }
  .lw-icon-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media print {
  .no-print,
  .ia-ambient,
  .ia-top,
  .ia-top-tools,
  .lw-rail,
  .lw-search-results,
  .lw-articles,
  .lw-empty,
  .lw-toast,
  .lw-dialog {
    display: none !important;
  }
  body.ia-body {
    background: #fff !important;
    color: #000 !important;
  }
  .lw-main {
    max-width: none;
    padding: 0;
  }
  .lw-hero {
    margin-bottom: 16px;
  }
  .lw-hero-title,
  .lw-print-title {
    color: #000 !important;
  }
  .lw-hero-sub,
  .lw-meta,
  .lw-print-meta {
    color: #333 !important;
  }
  .lw-panel {
    border: 0;
    background: transparent;
    padding: 0;
    min-height: 0;
  }
  .lw-print-all,
  .lw-print-all:not([hidden]) {
    display: block !important;
  }
  .lw-print-section {
    break-inside: avoid;
    margin: 0 0 22px;
  }
  .lw-print-section h2 {
    margin: 0 0 10px;
    font-family: var(--lw-display);
    font-size: 1.25rem;
    color: #000;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
  }
  .lw-print-article,
  .lw-article {
    display: block;
    break-inside: avoid;
    page-break-inside: avoid;
    border: 0;
    border-bottom: 1px solid #ddd;
    border-radius: 0;
    background: #fff;
    color: #000;
    margin-bottom: 0;
    padding: 12px 0;
  }
  .lw-chapter-head {
    border-bottom-color: #ccc;
  }
  .lw-chapter-title {
    color: #555 !important;
  }
  .lw-article-id {
    color: #b00030 !important;
  }
  .lw-article-title,
  .lw-article-text {
    color: #000 !important;
  }
  .lw-article-penalty {
    color: #6b5420 !important;
  }
  .lw-chip,
  .lw-chip strong {
    color: #000 !important;
  }
  .lw-chip {
    background: #f5f5f5;
    border-color: #ccc;
  }
}

@media (max-width: 720px) {
  .ia-top-inner { flex-direction: column; align-items: stretch; }
  .ia-top-tools {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .lw-search { width: 100%; max-width: none; flex: 1 1 100%; }
  .lw-btn span,
  .ia-btn span { display: none; }
  .lw-btn--discord .lw-discord-ico { display: grid; }
  .lw-btn--discord .lw-discord-text { display: none; }
  .lw-btn--discord { padding: 0 12px; }
  .lw-menu-item span { display: inline; }
  .lw-punish-row { grid-template-columns: 1fr; }
  .lw-main { padding-top: 20px; }
  .lw-panel { padding: 14px; }
  .lw-article {
    padding: 14px 0 16px;
  }
  .lw-article-text,
  .lw-article-penalty {
    margin-left: 0;
  }
  .lw-article-tools {
    opacity: 1;
  }
  .lw-article-title {
    font-size: 1.02rem;
  }
  .lw-article-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 2.25rem;
    padding: 0 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lw-toast { transition: none; }
}
