
      @font-face {
        font-family: "Hero King";
        src: url("/assets/fonts/Heroking-Regular.ttf") format("truetype");
        font-display: swap;
      }
      @font-face {
        font-family: "Dragon Force";
        src: url("/assets/fonts/DragonForcE.ttf") format("truetype");
        font-display: swap;
      }
      @font-face {
        font-family: "Tribal Dragon";
        src: url("/assets/fonts/TribalDragon-23Ll.ttf") format("truetype");
        font-display: swap;
      }
      :root {
        color-scheme: dark;
        --bg: #150f09;
        --panel: #ead8ae;
        --panel-2: #d9bf82;
        --panel-3: #f5e7bf;
        --line: rgba(98, 62, 24, 0.36);
        --muted: #725736;
        --text: #241509;
        --ink: #241509;
        --paper: #f2dfae;
        --paper-soft: #fff2c8;
        --paper-deep: #c9974f;
        --leather: #26170d;
        --green: #4ff0aa;
        --red: #b3262f;
        --gold: #ffd65a;
        --gold-soft: #fff1a8;
        --ember: #a4451f;
        --blue: #8097ff;
        --pink: #b3262f;
        --glass: rgba(255, 236, 187, 0.78);
      }

      * { box-sizing: border-box; }
      html { min-width: 0; overflow-x: hidden; }
      body {
        margin: 0;
        background:
          linear-gradient(180deg, rgba(34, 25, 11, 0.28) 0%, rgba(31, 20, 9, 0.70) 46%, rgba(13, 8, 5, 0.88) 100%),
          radial-gradient(circle at 13% 92%, rgba(255, 210, 90, 0.20), transparent 28%),
          radial-gradient(circle at 86% 6%, rgba(255, 214, 90, 0.20), transparent 22%),
          url("/assets/kella-bg.png") center top / cover fixed,
          linear-gradient(180deg, #3d2b15 0%, #16100a 46%, #090604 100%),
          var(--bg);
        color: var(--text);
        font-family: "Trebuchet MS", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
        min-height: 100vh;
        min-width: 0;
        overflow-x: hidden;
      }
      body.mobile-nav-open { overflow: hidden; }

      button, input, select, textarea { font: inherit; }
      button { cursor: pointer; }
      button:disabled { cursor: not-allowed; opacity: 0.62; }
      a { color: inherit; }
      img, svg, video, canvas { max-width: 100%; }

      .shell {
        width: min(1240px, calc(100vw - 28px));
        min-height: min(820px, calc(100vh - 32px));
        margin: 16px auto;
        display: grid;
        grid-template-columns: 245px 1fr;
        overflow: hidden;
        border: 2px solid rgba(255, 214, 90, 0.52);
        border-radius: 18px;
        background:
          linear-gradient(90deg, rgba(67, 42, 20, 0.32), transparent 21%, transparent 79%, rgba(67, 42, 20, 0.22)),
          var(--paper);
        box-shadow: 0 34px 110px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(105, 64, 24, 0.22), inset 0 0 44px rgba(92, 55, 18, 0.16);
        backdrop-filter: blur(12px);
      }
      .shell > aside {
        color: #fff8d7;
        border-right: 2px solid rgba(111, 69, 25, 0.56);
        background:
          radial-gradient(circle at 50% -10%, rgba(255, 214, 90, 0.16), transparent 34%),
          linear-gradient(180deg, rgba(59, 36, 18, 0.82), rgba(17, 10, 6, 0.96) 64%, #090604 100%);
        padding: 20px 14px;
        display: flex;
        flex-direction: column;
        min-width: 0;
      }

      .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding: 0 7px; }
      .mark {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--pink), #9f1731);
        display: grid;
        place-items: center;
        font-weight: 1000;
        color: white;
        box-shadow: 0 0 26px rgba(255, 69, 101, 0.26);
      }
      .brand-logo {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        object-fit: cover;
        background: #12141c;
        border: 1px solid rgba(250, 204, 21, 0.28);
        box-shadow: 0 0 28px rgba(250, 204, 21, 0.16), 0 0 34px rgba(255, 69, 101, 0.18);
      }
      .brand strong { display: block; letter-spacing: 0.03em; font-size: 16px; color: #fff7d6; }
      .brand span { color: var(--gold-soft); font-size: 11px; text-transform: uppercase; font-weight: 900; letter-spacing: 0.08em; }

      nav { display: grid; gap: 7px; }
      nav a {
        color: #f3dfaa;
        text-decoration: none;
        border: 1px solid transparent;
        border-radius: 6px;
        padding: 9px 10px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        font-weight: 900;
        font-size: 14px;
        text-shadow: 0 1px 0 rgba(0,0,0,0.42);
        transition: background 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
        min-width: 0;
      }
      nav a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .nav-icon {
        width: 28px;
        height: 28px;
        object-fit: contain;
        flex: 0 0 auto;
        filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.20));
        transition: transform 160ms ease, filter 160ms ease;
      }
      nav a.active, nav a:hover {
        background:
          linear-gradient(180deg, rgba(255, 246, 162, 0.98), rgba(236, 164, 50, 0.96)),
          var(--gold);
        border-color: rgba(255, 249, 184, 0.92);
        color: #221205;
        transform: translateX(2px);
        text-shadow: 0 1px 0 rgba(255,255,255,0.46);
        box-shadow: 0 0 0 1px rgba(103, 58, 14, 0.34), 0 0 20px rgba(255, 214, 90, 0.46), inset 0 0 18px rgba(255, 251, 210, 0.52);
      }
      nav a.active .nav-icon, nav a:hover .nav-icon {
        transform: scale(1.08);
        filter: drop-shadow(0 0 12px rgba(255, 247, 214, 0.42));
      }
      .side-spacer { flex: 1; min-height: 24px; }
      .side-footer {
        margin-top: 24px;
        padding: 14px 8px 0;
        border-top: 1px solid rgba(255, 214, 90, 0.24);
        color: #d7bd82;
        font-size: 12px;
        font-weight: 850;
        line-height: 1.45;
      }
      .side-footer strong { display: block; color: #fff7d6; font-size: 13px; margin-bottom: 4px; }

      main {
        padding: 0;
        min-width: 0;
        background:
          radial-gradient(circle at 72% 5%, rgba(255, 214, 90, 0.18), transparent 30%),
          linear-gradient(90deg, rgba(83, 49, 18, 0.16), transparent 16%, transparent 84%, rgba(83, 49, 18, 0.12)),
          radial-gradient(circle at 50% 36%, rgba(255,255,255,0.20), transparent 42%),
          var(--paper);
      }
      .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 14px;
        min-height: 58px;
        border-bottom: 2px solid rgba(102, 63, 24, 0.36);
        background:
          linear-gradient(180deg, rgba(255, 242, 197, 0.90), rgba(224, 189, 124, 0.64)),
          var(--paper-soft);
        padding: 10px 20px;
      }
      .server-clock {
        display: grid;
        justify-items: end;
        gap: 2px;
        min-width: 142px;
        border: 1px solid rgba(109, 69, 25, 0.30);
        border-radius: 10px;
        background: rgba(70, 43, 18, 0.12);
        padding: 8px 11px;
      }
      .server-clock span {
        color: #6a4b22;
        font-size: 10px;
        font-weight: 1000;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .server-clock strong {
        color: #241509;
        font-size: 13px;
      }
      .top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
      .top-actions .server-clock { min-width: 150px; }
      .auth-pill {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 36px;
        padding: 0 12px;
        border: 1px solid rgba(255, 214, 90, 0.42);
        border-radius: 999px;
        background: rgba(54, 35, 17, 0.54);
        color: #fff4cf;
        font-size: 12px;
        font-weight: 900;
        white-space: nowrap;
      }
      .icon-button {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        display: grid;
        place-items: center;
        background: rgba(255, 244, 205, 0.62);
        color: #3b220c;
        border: 1px solid rgba(109, 69, 25, 0.30);
        padding: 0;
      }
      .auth-button {
        min-height: 36px;
        border-radius: 10px;
        border: 1px solid rgba(109, 69, 25, 0.30);
        background: rgba(255, 244, 205, 0.72);
        color: #3b220c;
        padding: 0 13px;
        font-weight: 1000;
      }
      [data-auth-login], [data-auth-logout] { width: auto; padding: 0 10px; }
      .icon-button:hover { border-color: rgba(255, 214, 90, 0.92); color: #5c3106; box-shadow: 0 0 16px rgba(255, 214, 90, 0.28); }
      .profile-top-button {
        min-height: 46px;
        min-width: 174px;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        border: 1px solid rgba(109, 69, 25, 0.30);
        border-radius: 14px;
        background: rgba(255, 244, 205, 0.72);
        color: #3b220c;
        padding: 5px 12px 5px 7px;
        font-weight: 1000;
        text-align: left;
      }
      .profile-top-button:hover { border-color: rgba(255, 214, 90, 0.88); box-shadow: 0 0 18px rgba(255, 214, 90, 0.28); }
      .profile-top-button img { width: 34px; height: 34px; object-fit: contain; display: block; flex: 0 0 auto; }
      .profile-top-button span { display: grid; gap: 1px; line-height: 1.1; }
      .profile-top-button strong { font-size: 13px; }
      .profile-top-button em { color: #725736; font-size: 11px; font-style: normal; font-weight: 850; white-space: nowrap; }
      .feedback-top-button {
        min-width: 178px;
        border-color: rgba(166, 105, 35, 0.34);
        background: linear-gradient(180deg, rgba(255, 246, 211, 0.98), rgba(228, 179, 89, 0.72));
      }
      .feedback-top-button img { filter: drop-shadow(0 4px 7px rgba(106, 61, 18, 0.22)); }
      .mobile-nav-toggle, .mobile-nav-backdrop { display: none; }
      .wiki-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 14px;
      }
      .wiki-search-card {
        margin-bottom: 16px;
        padding: 16px;
      }
      .wiki-search-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
      }
      .wiki-search-row input {
        width: 100%;
        min-height: 46px;
        border-radius: 8px;
        border: 1px solid rgba(121, 82, 33, 0.32);
        background: rgba(255, 248, 221, 0.78);
        color: #2f1b09;
        font-weight: 800;
        padding: 0 14px;
      }
      .wiki-search-row input:focus {
        border-color: rgba(190, 123, 24, 0.78);
        box-shadow: 0 0 0 3px rgba(255, 214, 90, 0.22);
        outline: none;
      }
      .wiki-search-count {
        min-width: 112px;
        color: #68491f;
        font-size: 12px;
        font-weight: 1000;
        text-align: right;
        text-transform: uppercase;
        letter-spacing: 0.06em;
      }
      .wiki-card {
        min-height: 220px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 14px;
        background:
          linear-gradient(180deg, rgba(255, 248, 221, 0.94), rgba(236, 206, 134, 0.82)),
          radial-gradient(circle at 20% 0%, rgba(255, 214, 90, 0.34), transparent 36%);
      }
      .wiki-card h3 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 24px; }
      .wiki-card p { margin: 0; color: #5f4528; line-height: 1.45; }
      .wiki-thumb {
        width: 100%;
        height: 130px;
        border-radius: 12px;
        object-fit: cover;
        border: 1px solid rgba(113, 74, 30, 0.34);
        background: rgba(255, 246, 211, 0.72);
      }
      .wiki-editor {
        margin-bottom: 18px;
      }
      .wiki-builder-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        margin: 14px 0;
      }
      .wiki-builder {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        align-items: start;
      }
      .wiki-canvas-wrap {
        overflow: auto;
        scrollbar-gutter: stable both-edges;
        box-sizing: border-box;
        border-radius: 18px;
        width: min(850px, 100%);
        max-height: min(1080px, calc(100vh - 300px));
        margin: 0 auto;
        padding: 22px;
        background:
          radial-gradient(circle at 50% 0%, rgba(255,255,255,0.28), transparent 40%),
          linear-gradient(180deg, rgba(77, 48, 18, 0.18), rgba(52, 31, 11, 0.10));
        border: 1px solid rgba(126, 82, 31, 0.24);
      }
      .wiki-page-canvas,
      .wiki-reader-page {
        position: relative;
        width: 760px;
        height: var(--wiki-page-height, 980px);
        min-height: 980px;
        max-width: 100%;
        margin: 0 auto;
        overflow: visible;
        border-radius: 8px;
        color: #3f2a13;
        background:
          linear-gradient(90deg, rgba(104, 70, 31, 0.08), transparent 7%, transparent 93%, rgba(104, 70, 31, 0.08)),
          radial-gradient(circle at 18% 16%, rgba(255,255,255,0.32), transparent 22%),
          radial-gradient(circle at 80% 78%, rgba(151, 98, 44, 0.16), transparent 28%),
          linear-gradient(180deg, #f7e9bd, #dfbd75);
        border: 1px solid rgba(111, 71, 25, 0.38);
        box-shadow: inset 0 0 42px rgba(122, 80, 34, 0.17), 0 18px 36px rgba(55, 32, 12, 0.24);
      }
      .wiki-page-canvas {
        max-width: none;
      }
      .wiki-reader-stage {
        position: relative;
        width: 100%;
        min-height: 240px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-gutter: stable both-edges;
        box-sizing: border-box;
        overscroll-behavior-x: contain;
        overscroll-behavior-y: auto;
        touch-action: pan-y pinch-zoom;
        border-radius: 12px;
        background: rgba(77, 48, 18, 0.10);
      }
      .wiki-reader-stage .wiki-reader-page {
        position: absolute;
        top: 0;
        left: 0;
        max-width: none;
        margin: 0;
        transform: scale(var(--wiki-reader-scale, 1));
        transform-origin: top left;
      }
      .wiki-reader-sizer {
        position: relative;
        margin: 0 auto;
      }
      .wiki-reader-toolbar {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        margin-bottom: 8px;
      }
      .wiki-reader-toolbar button {
        min-width: 38px;
        min-height: 36px;
        padding: 6px 10px;
      }
      .wiki-reader-zoom {
        min-width: 58px;
        color: #68491f;
        font-size: 12px;
        font-weight: 1000;
        text-align: center;
      }
      .wiki-page-canvas::before,
      .wiki-reader-page::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image:
          linear-gradient(rgba(116, 77, 35, 0.035) 1px, transparent 1px),
          linear-gradient(90deg, rgba(116, 77, 35, 0.025) 1px, transparent 1px);
        background-size: 28px 28px;
        pointer-events: none;
      }
      .wiki-block {
        position: absolute;
        z-index: 1;
        box-sizing: border-box;
        border: 1px dashed transparent;
        border-radius: 12px;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
      }
      .wiki-page-canvas .wiki-block:hover,
      .wiki-block.selected {
        border-color: rgba(170, 100, 11, 0.82);
        box-shadow: 0 0 0 4px rgba(255, 214, 90, 0.24);
      }
      /* D: shadow as a non-clipped layer behind content — does not affect block dimensions */
      .wiki-image-block.wiki-block--shadowed {
        position: relative;
        z-index: 0;
      }
      .wiki-image-block.wiki-block--shadowed::before {
        content: "";
        position: absolute;
        inset: 8px;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
        z-index: 0;
        pointer-events: none;
      }
      .wiki-image-block.wiki-block--shadowed .wiki-media-frame {
        overflow: visible;
        position: relative;
        z-index: 1;
      }
      /* D: text shadow — renders on the text element, does not change block dimensions */
      .wiki-block--shadowed .wiki-text-content {
        text-shadow: 2px 3px 6px rgba(0, 0, 0, 0.55);
      }
      .wiki-text-block {
        display: flex;
        align-items: flex-start;
        padding: 12px 14px;
        line-height: 1.35;
        white-space: pre-wrap;
        overflow: visible;
        min-height: 48px;
      }
      .wiki-text-content {
        box-sizing: border-box;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        min-height: 0;
        outline: none;
        overflow: auto;
        overscroll-behavior: contain;
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: pre-wrap;
      }
      .wiki-inline-image {
        display: inline-block;
        width: 1.35em;
        height: 1.35em;
        margin: 0 0.12em;
        vertical-align: -0.28em;
        object-fit: contain;
        border-radius: 0.22em;
        user-select: all;
      }
      .wiki-image-block {
        padding: 0;
        background: rgba(255, 246, 211, 0.28);
        touch-action: none;
      }
      .wiki-media-frame {
        position: absolute;
        inset: 8px;
        overflow: visible;
        border-radius: 10px;
        background: rgba(76, 47, 18, 0.08);
      }
      .wiki-image-block img[data-wiki-media] {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        max-width: none;
        transform-origin: center;
        cursor: grab;
        user-select: none;
        touch-action: none;
        will-change: transform;
      }
      .wiki-image-block img[data-wiki-media]:active {
        cursor: grabbing;
      }
      .wiki-video-block {
        padding: 8px;
        background: rgba(255, 246, 211, 0.28);
      }
      .wiki-video-block video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        border-radius: 10px;
        background: #1f160d;
        box-shadow: 0 10px 24px rgba(68, 39, 13, 0.20);
      }
      .wiki-drag-handle,
      .wiki-resize-handle,
      .wiki-delete-block-button {
        position: absolute;
        z-index: 4;
        display: grid;
        place-items: center;
        color: #3f2a13;
        background: rgba(255, 228, 138, 0.96);
        border: 1px solid rgba(127, 80, 25, 0.38);
        box-shadow: 0 8px 16px rgba(67, 37, 10, 0.16);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s ease, transform 0.15s ease;
      }
      .wiki-drag-handle {
        left: 50%;
        top: -16px;
        transform: translateX(-50%);
        width: 30px;
        height: 30px;
        padding: 0;
        border-radius: 999px;
        cursor: move;
        font-size: 0;
        font-weight: 1000;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }
      .wiki-drag-handle::after {
        content: "";
        display: block;
        width: 13px;
        height: 13px;
        border-radius: 3px;
        background:
          linear-gradient(#3f2a13, #3f2a13) center / 13px 2px no-repeat,
          linear-gradient(#3f2a13, #3f2a13) center / 2px 13px no-repeat;
        opacity: 0.82;
      }
      .wiki-block:hover .wiki-drag-handle,
      .wiki-block:hover .wiki-resize-handle,
      .wiki-block.selected .wiki-drag-handle,
      .wiki-block.selected .wiki-resize-handle {
        opacity: 0.96;
        pointer-events: auto;
      }
      .wiki-resize-handle {
        width: 18px;
        height: 18px;
        border-radius: 6px;
      }
      .wiki-resize-nw { left: -7px; top: -7px; cursor: nwse-resize; }
      .wiki-resize-ne { right: -7px; top: -7px; cursor: nesw-resize; }
      .wiki-resize-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
      .wiki-resize-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
      .wiki-delete-block-button {
        top: -17px;
        right: 20px;
        width: 30px;
        height: 30px;
        border: 1px solid rgba(127, 21, 18, 0.72);
        border-radius: 999px;
        color: #fff7df;
        background: linear-gradient(180deg, #9e241b, #72120f);
        font-size: 18px;
        font-weight: 1000;
        line-height: 1;
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        box-shadow: 0 8px 16px rgba(67, 20, 10, 0.22);
      }
      .wiki-block:hover .wiki-delete-block-button,
      .wiki-block.selected .wiki-delete-block-button {
        opacity: 0.98;
        pointer-events: auto;
      }
      .wiki-add-text-inline {
        position: absolute;
        left: 50%;
        bottom: -44px;
        z-index: 6;
        transform: translateX(-50%);
        min-width: 150px;
        min-height: 34px;
        border: 1px solid rgba(121, 82, 33, 0.34);
        border-radius: 999px;
        background: linear-gradient(180deg, #fff3bc, #e7bc61);
        color: #5a3411;
        font-weight: 1000;
        box-shadow: 0 10px 20px rgba(64, 37, 11, 0.18);
        cursor: pointer;
      }
      .wiki-add-text-inline:hover {
        filter: brightness(1.04);
        transform: translateX(-50%) translateY(-1px);
      }
      .wiki-add-text-inline--empty {
        top: 150px;
        bottom: auto;
      }
      .wiki-inspector {
        position: sticky;
        top: 10px;
        z-index: 16;
        display: flex;
        flex-direction: column;
        gap: 8px;
        border-radius: 18px;
        border: 1px solid rgba(121, 82, 33, 0.34);
        padding: 12px;
        margin: 14px 0 16px;
        background: linear-gradient(180deg, rgba(255, 246, 214, 0.96), rgba(230, 193, 112, 0.82));
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.42);
      }
      .wiki-inspector--empty {
        flex-direction: column;
        gap: 8px;
      }
      .wiki-editor .wiki-inspector,
      .wiki-editor .wiki-inspector button,
      .wiki-editor .wiki-inspector input,
      .wiki-editor .wiki-inspector select {
        font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
      }
      /* F: new grouped inspector layout */
      .wiki-inspector__group {
        display: flex;
        flex-direction: column;
        gap: 6px;
      }
      .wiki-inspector__group--assets {
        flex-direction: column;
      }
      .wiki-inspector__header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
      }
      .wiki-inspector__label {
        color: #6b431c;
        font-size: 11px;
        font-weight: 1000;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        white-space: nowrap;
      }
      .wiki-control-row {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        align-items: end;
      }
      .wiki-control-row label {
        min-width: 80px;
        flex: 1 1 100px;
        display: flex;
        flex-direction: column;
        gap: 2px;
      }
      .wiki-control-row button { min-height: 36px; }
      .wiki-control-row .wiki-format-button { min-width: 36px; }
      .wiki-color-control input[type="color"] {
        width: 36px;
        height: 32px;
        padding: 0;
        border: 1px solid rgba(121, 82, 33, 0.32);
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
      }
      .wiki-editor .wiki-inspector button,
      .wiki-editor .wiki-inspector input,
      .wiki-editor .wiki-inspector select,
      .wiki-editor .wiki-inspector label {
        font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
      }
      .wiki-inspector h4 {
        margin: 0;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 22px;
        line-height: 1;
      }
      .wiki-shadow-button.active {
        border-color: rgba(190, 123, 24, 0.78);
        background: linear-gradient(180deg, #fff2b5, #e7b84e);
        box-shadow: 0 3px 8px rgba(55, 32, 12, 0.32);
      }
      .wiki-shadow-controls {
        grid-column: 1 / -1;
        border: 1px solid rgba(121, 82, 33, 0.18);
        border-radius: 10px;
        padding: 7px;
        background: rgba(255, 250, 231, 0.44);
      }
      .wiki-shadow-controls summary {
        cursor: pointer;
        font-size: 12px;
        font-weight: 1000;
      }
      .wiki-shadow-grid {
        display: grid;
        grid-template-columns: repeat(5, minmax(64px, 1fr));
        gap: 6px;
        margin-top: 7px;
      }
      .wiki-shadow-grid label { min-width: 0; }
      .wiki-shadow-toggle { display: flex !important; align-items: center; gap: 7px; }
      .wiki-shadow-toggle input { width: auto; }
      .wiki-inline-format {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, 38px) minmax(108px, 1fr) minmax(72px, 0.7fr);
        gap: 6px;
        align-items: end;
      }
      .wiki-format-button {
        min-width: 38px;
        min-height: 38px;
        padding: 6px;
        border: 1px solid rgba(121, 82, 33, 0.32);
        border-radius: 9px;
        background: rgba(255, 250, 230, 0.88);
        color: #3f2a13;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 16px;
        font-weight: 900;
      }
      .wiki-format-button:hover,
      .wiki-format-button.active {
        border-color: rgba(190, 123, 24, 0.78);
        background: linear-gradient(180deg, #fff2b5, #e7b84e);
      }
      .wiki-format-button[data-wiki-inline-command="italic"] { font-style: italic; }
      .wiki-format-button[data-wiki-inline-command="underline"] { text-decoration: underline; }
      .wiki-inline-format label { min-width: 0; }
      .wiki-color-control {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: end;
      }
      .wiki-color-wheel {
        width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 2px !important;
        border-radius: 50% !important;
        cursor: pointer;
        overflow: hidden;
        background: rgba(255, 250, 230, 0.88);
      }
      .wiki-color-wheel::-webkit-color-swatch-wrapper { padding: 2px; }
      .wiki-color-wheel::-webkit-color-swatch {
        border: 0;
        border-radius: 50%;
      }
      .wiki-color-wheel::-moz-color-swatch {
        border: 0;
        border-radius: 50%;
      }
      .wiki-font-option-hero { font-family: "Hero King", Georgia, serif; }
      .wiki-font-option-force { font-family: "Dragon Force", Georgia, serif; }
      .wiki-font-option-tribal { font-family: "Tribal Dragon", Georgia, serif; }
      .wiki-share-button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
      }
      .wiki-style-actions {
        align-self: stretch;
        display: grid;
        align-content: stretch;
        min-width: 0;
        padding: 8px;
        border-radius: 14px;
        background: rgba(255, 248, 221, 0.38);
        border: 1px solid rgba(121, 82, 33, 0.16);
      }
      .wiki-inspector label {
        display: grid;
        gap: 4px;
        margin-bottom: 0;
        font-size: 12px;
        font-weight: 900;
        color: #5a3818;
      }
      .wiki-inspector input,
      .wiki-inspector select {
        min-height: 34px;
      }
      .wiki-image-tools {
        display: grid;
        gap: 6px;
        margin-top: 0;
      }
      .wiki-image-tool-row {
        display: grid;
        grid-template-columns: repeat(5, minmax(72px, 1fr));
        gap: 6px;
      }
      .wiki-add-block-row {
        display: grid;
        grid-template-columns: minmax(120px, 1fr);
        gap: 6px;
      }
      .wiki-add-block-row .secondary {
        width: 100%;
      }
      .wiki-misc-picker {
        min-width: 0;
        margin-top: 0;
        position: relative;
      }
      .wiki-misc-picker > button {
        width: 100%;
      }
      .wiki-misc-panel {
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(4, minmax(74px, 1fr));
        gap: 8px;
        width: min(420px, calc(100vw - 36px));
        max-height: min(460px, 68vh);
        margin-top: 0;
        padding: 8px;
        overflow: auto;
        border: 1px solid rgba(121, 82, 33, 0.30);
        border-radius: 14px;
        background:
          linear-gradient(180deg, rgba(255, 250, 226, 0.98), rgba(238, 207, 137, 0.96)),
          radial-gradient(circle at 50% 0%, rgba(255, 215, 87, 0.28), transparent 55%);
        box-shadow: 0 22px 46px rgba(64, 37, 11, 0.28);
      }
      .wiki-misc-panel--hero {
        width: min(430px, calc(100vw - 36px));
        max-height: min(520px, 72vh);
        grid-template-columns: repeat(2, minmax(160px, 1fr));
        padding: 12px;
      }
      .wiki-misc-panel[hidden] {
        display: none;
      }
      .wiki-asset-search {
        grid-column: 1 / -1;
        display: block;
      }
      .wiki-asset-search input {
        width: 100%;
        min-height: 38px;
        padding: 9px 12px;
        border: 1px solid rgba(121, 82, 33, 0.32);
        border-radius: 12px;
        background: rgba(255, 250, 230, 0.90);
        color: #3f2a13;
        font-weight: 800;
      }
      .wiki-asset-search input:focus {
        outline: 2px solid rgba(218, 154, 37, 0.46);
        border-color: rgba(173, 112, 28, 0.72);
      }
      .wiki-asset-empty {
        grid-column: 1 / -1;
        padding: 14px;
        border: 1px dashed rgba(121, 82, 33, 0.36);
        border-radius: 12px;
        color: #71512b;
        font-weight: 900;
        text-align: center;
      }

      .buff-schedule-shell { display: grid; gap: 16px; }
      .buff-notice, .buff-footer {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px 18px;
        border: 1px solid rgba(143, 95, 28, 0.28);
        border-radius: 10px;
        background: rgba(255, 250, 226, 0.68);
      }
      .buff-notice img, .buff-footer img { width: 38px; height: 38px; object-fit: contain; flex: 0 0 auto; }
      .buff-notice strong, .buff-footer strong { display: block; margin-bottom: 3px; color: #70400d; }
      .buff-week { overflow: hidden; padding: 0; }
      .buff-week-heading, .buff-day-row {
        display: grid;
        grid-template-columns: 140px minmax(260px, 1fr) minmax(280px, 0.9fr);
        align-items: center;
        gap: 20px;
      }
      .buff-week-heading {
        padding: 13px 22px;
        color: #75512b;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        border-bottom: 1px solid rgba(143, 95, 28, 0.25);
      }
      .buff-day-row { position: relative; min-height: 112px; padding: 14px 22px; border-bottom: 1px solid rgba(143, 95, 28, 0.19); }
      .buff-day-row:last-child { border-bottom: 0; }
      .buff-day-row.is-today { background: linear-gradient(90deg, rgba(117, 183, 91, 0.2), rgba(255, 250, 226, 0.18)); box-shadow: inset 5px 0 #62a54d; }
      .buff-day-name { display: flex; align-items: center; gap: 9px; font: 800 18px Georgia, serif; color: #34210f; }
      .buff-today { padding: 4px 8px; border-radius: 999px; background: #dff1d2; color: #39762e; font: 800 9px Arial, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
      .buff-current { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 14px; min-width: 0; }
      .buff-icon { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 5px 7px rgba(75, 45, 10, 0.2)); }
      .buff-current h3 { margin: 0 0 4px; color: #2f702e; font-size: 19px; }
      .buff-current p { margin: 0; color: #725837; font-size: 13px; line-height: 1.45; }
      .buff-note { display: block; margin-top: 6px; color: #c36516; font-size: 11px; font-weight: 800; }
      .buff-admin-setting { display: grid; gap: 8px; }
      .buff-admin-setting select, .buff-admin-setting input { width: 100%; margin: 0; }
      .buff-admin-setting select { min-height: 46px; font-weight: 800; }
      .buff-readonly { justify-self: start; padding: 8px 12px; border-radius: 999px; background: rgba(206, 151, 42, 0.13); color: #795119; font-size: 12px; font-weight: 800; }
      .buff-updated { text-align: right; color: #876a43; font-size: 12px; }
      .buff-publish-toggle {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        min-height: 38px;
        padding: 6px 10px;
        border: 1px solid rgba(143, 95, 28, 0.28);
        border-radius: 999px;
        background: rgba(255, 250, 226, 0.66);
        color: #5d3d1b;
        cursor: pointer;
        font-size: 12px;
        font-weight: 900;
      }
      .buff-publish-toggle input { position: absolute; opacity: 0; pointer-events: none; }
      .buff-toggle-track { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 999px; background: #b9a78b; transition: background 150ms ease; }
      .buff-toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff8df; box-shadow: 0 2px 5px rgba(64, 37, 11, 0.28); transition: transform 150ms ease; }
      .buff-publish-toggle input:checked + .buff-toggle-track { background: linear-gradient(180deg, #e4ad2f, #b96d12); }
      .buff-publish-toggle input:checked + .buff-toggle-track::after { transform: translateX(16px); }
      .buff-publish-toggle input:focus-visible + .buff-toggle-track { outline: 2px solid #d59b25; outline-offset: 2px; }
      .buff-date-list { display: grid; gap: 9px; }
      .buff-date-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 13px; border: 1px solid rgba(143, 95, 28, 0.22); border-radius: 9px; background: rgba(255, 250, 226, 0.54); }
      .buff-date-item img { width: 44px; height: 44px; object-fit: contain; }
      .buff-date-item h4 { margin: 0 0 3px; }
      .buff-date-item span { color: #76572f; font-size: 12px; }
      .training-shell { display: grid; gap: 16px; }
      .training-intro {
        display: grid;
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 18px;
        align-items: center;
        padding: 18px 20px;
        border: 1px solid rgba(143, 95, 28, 0.28);
        border-radius: 12px;
        background: linear-gradient(110deg, rgba(255, 249, 224, 0.84), rgba(232, 195, 114, 0.48));
      }
      .training-intro img {
        width: 76px;
        height: 76px;
        object-fit: contain;
        filter: drop-shadow(0 8px 10px rgba(67, 37, 10, 0.24));
      }
      .training-intro strong { display: block; margin-bottom: 5px; color: #3d270f; font: 900 19px Georgia, serif; }
      .training-intro span { color: #775735; line-height: 1.5; }
      .training-resource-settings {
        display: grid;
        grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
        gap: 16px;
        align-items: center;
        padding: 14px 16px;
        border: 1px solid rgba(143, 95, 28, 0.26);
        border-radius: 12px;
        background: rgba(255, 248, 220, 0.72);
      }
      .training-resource-settings[hidden] { display: none; }
      .training-resource-settings label { display: grid; gap: 6px; color: #5e3c1c; font-size: 12px; font-weight: 900; }
      .training-resource-settings select { width: 100%; min-height: 46px; margin: 0; }
      .training-resource-settings strong { display: block; margin-bottom: 3px; color: #4c3015; }
      .training-resource-settings span { color: #7b5c38; font-size: 12px; line-height: 1.4; }
      .training-mode-tabs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        padding: 7px;
        border: 1px solid rgba(143, 95, 28, 0.28);
        border-radius: 12px;
        background: rgba(238, 208, 143, 0.62);
      }
      .training-mode-button {
        min-height: 48px;
        border: 1px solid transparent;
        border-radius: 9px;
        background: transparent;
        color: #6b4a25;
        font-weight: 950;
      }
      .training-mode-button:hover { border-color: rgba(172, 109, 22, 0.30); background: rgba(255, 249, 225, 0.55); }
      .training-mode-button.active {
        border-color: #c58619;
        background: linear-gradient(180deg, #ffe99a, #df9f24);
        color: #3e2609;
        box-shadow: 0 9px 20px rgba(137, 79, 12, 0.22), inset 0 1px rgba(255,255,255,0.68);
      }
      .training-panel[hidden] { display: none; }
      .training-calculator-card { padding: 20px; }
      .training-panel-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
      .training-panel-head h3 { margin: 0 0 4px; }
      .training-panel-head p { margin: 0; color: #7b5c38; line-height: 1.45; }
      .training-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
      .training-time-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
      .training-input-grid label, .training-time-grid label { display: grid; gap: 6px; color: #5e3c1c; font-size: 12px; font-weight: 900; }
      .training-input-grid input, .training-input-grid select, .training-time-grid input { width: 100%; min-height: 46px; margin: 0; }
      .training-troop-inputs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
      .training-troop-inputs label { display: grid; gap: 5px; min-width: 0; color: #5e3c1c; font-size: 11px; font-weight: 950; text-align: center; }
      .training-troop-inputs input { width: 100%; min-height: 45px; margin: 0; text-align: center; }
      .training-results { margin-top: 18px; }
      .training-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
      .training-summary {
        min-height: 82px;
        padding: 13px 14px;
        border: 1px solid rgba(143, 95, 28, 0.22);
        border-radius: 10px;
        background: rgba(255, 249, 224, 0.64);
      }
      .training-summary span { display: block; margin-bottom: 6px; color: #84633d; font-size: 10px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
      .training-summary strong { color: #3a230d; font-size: 20px; line-height: 1.1; }
      .training-table-wrap { overflow-x: auto; border: 1px solid rgba(143, 95, 28, 0.26); border-radius: 11px; }
      .training-table { width: 100%; min-width: 570px; margin: 0; }
      .training-table-resources { min-width: 850px; }
      .training-table th { color: #73512c; background: rgba(219, 171, 75, 0.20); }
      .training-table td, .training-table th { border-color: rgba(143, 95, 28, 0.18); }
      .training-tier { display: flex; align-items: center; gap: 10px; font-weight: 950; }
      .training-tier-badge { display: grid; width: 38px; height: 32px; place-items: center; border-radius: 8px; background: #f2cf7b; color: #623a0d; }
      .training-note { margin: 12px 0 0; color: #806140; font-size: 12px; line-height: 1.5; }
      .training-empty { padding: 28px 16px; color: #806140; text-align: center; font-weight: 800; }
      .training-compact-value { white-space: nowrap; }
      .training-resource-list { display: grid; grid-template-columns: repeat(4, minmax(72px, 1fr)); gap: 6px; min-width: 330px; }
      .training-resource {
        display: grid;
        grid-template-columns: 30px 1fr;
        gap: 1px 5px;
        align-items: center;
        padding: 7px 8px;
        border: 1px solid rgba(139, 91, 24, 0.18);
        border-radius: 8px;
        background: rgba(255, 248, 221, 0.72);
      }
      .training-resource img { grid-row: 1 / 3; width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(67, 41, 15, .24)); }
      .training-resource small { color: #80603a; font-size: 8px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
      .training-resource strong { color: #43290f; font-size: 12px; }
      .training-resource-summary {
        display: grid;
        grid-template-columns: minmax(170px, 0.7fr) minmax(420px, 1.7fr);
        gap: 14px;
        align-items: center;
        margin: 0 0 14px;
        padding: 13px 14px;
        border: 1px solid rgba(143, 95, 28, 0.25);
        border-radius: 11px;
        background: linear-gradient(110deg, rgba(255, 246, 206, 0.88), rgba(231, 192, 105, 0.40));
      }
      .training-resource-summary-title strong { display: block; color: #44290f; font: 900 16px Georgia, serif; }
      .training-resource-summary-title span { color: #7b5c38; font-size: 10px; }
      .training-mix-tier-tabs {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        margin: 16px 0;
      }
      .training-mix-tier-button {
        min-height: 48px;
        padding: 8px;
        border: 1px solid rgba(143, 95, 28, 0.28);
        border-radius: 9px;
        background: rgba(255, 249, 224, 0.72);
        color: #69461f;
        font-weight: 900;
      }
      .training-mix-tier-button.active {
        border-color: #c58619;
        background: linear-gradient(180deg, #ffe99a, #df9f24);
        color: #3e2609;
        box-shadow: 0 6px 14px rgba(137, 79, 12, 0.18);
      }
      .training-mix-troops { display: grid; gap: 8px; margin: 0 0 16px; }
      .training-mix-row {
        display: grid;
        grid-template-columns: 110px minmax(160px, 1fr) 110px 58px;
        gap: 10px;
        align-items: center;
        padding: 10px 12px;
        border: 1px solid rgba(143, 95, 28, 0.20);
        border-radius: 10px;
        background: rgba(255, 249, 224, 0.62);
      }
      .training-mix-row > strong { color: #4b2e13; }
      .training-mix-row input[type="range"] { width: 100%; accent-color: #cc8a18; }
      .training-mix-row input[type="number"] { width: 100%; min-height: 42px; margin: 0; text-align: center; }
      .training-mix-row output { color: #8a642f; font-size: 11px; font-weight: 900; text-align: right; }
      .training-plan-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 14px 0; }
      .training-plan-actions button:disabled { cursor: not-allowed; opacity: 0.48; }
      .training-saved-plan { margin-top: 20px; }
      .training-saved-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
      .training-saved-plan-head h3 { margin: 0; }
      .training-step-units { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 240px; }
      .training-step-units span { white-space: nowrap; }
      .training-step-remove { min-width: 34px; min-height: 34px; padding: 0; border-radius: 50%; }
      .wiki-misc-panel--artifact {
        width: min(470px, calc(100vw - 36px));
        max-height: min(520px, 72vh);
        grid-template-columns: repeat(3, minmax(120px, 1fr));
        padding: 12px;
      }
      .wiki-misc-panel--pet {
        width: min(470px, calc(100vw - 36px));
        max-height: min(520px, 72vh);
        grid-template-columns: repeat(3, minmax(120px, 1fr));
        padding: 12px;
      }
      .wiki-misc-panel--marker {
        width: min(350px, calc(100vw - 36px));
        max-height: min(440px, 66vh);
        grid-template-columns: repeat(4, minmax(62px, 1fr));
      }
      .wiki-misc-tile {
        display: grid;
        gap: 4px;
        justify-items: center;
        align-content: center;
        min-height: 86px;
        padding: 7px;
        border: 1px solid rgba(121, 82, 33, 0.24);
        border-radius: 12px;
        background: rgba(255, 244, 201, 0.72);
        color: #4a2d13;
        cursor: grab;
      }
      .wiki-misc-tile:hover {
        border-color: rgba(173, 112, 28, 0.68);
        box-shadow: 0 8px 18px rgba(101, 63, 20, 0.16);
      }
      .wiki-misc-upload {
        border-style: dashed;
        background: linear-gradient(180deg, rgba(255, 245, 202, 0.95), rgba(231, 196, 116, 0.72));
        cursor: pointer;
      }
      .wiki-upload-plus {
        display: grid;
        width: 44px;
        height: 44px;
        place-items: center;
        border: 1px solid rgba(121, 82, 33, 0.26);
        border-radius: 14px;
        background: rgba(255, 252, 232, 0.72);
        color: #8a4d08;
        font-size: 28px;
        font-weight: 950;
        line-height: 1;
      }
      .wiki-misc-tile img {
        width: 100%;
        height: 54px;
        object-fit: contain;
        pointer-events: none;
      }
      .wiki-misc-tile span {
        max-width: 100%;
        overflow: hidden;
        color: #68491f;
        font-size: 11px;
        font-weight: 800;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .wiki-misc-tile--hero {
        min-height: 190px;
        padding: 10px;
        gap: 8px;
        align-content: start;
        background: linear-gradient(180deg, rgba(255, 248, 217, 0.90), rgba(231, 196, 116, 0.72));
      }
      .wiki-misc-tile--hero img {
        height: 142px;
      }
      .wiki-misc-tile--hero span {
        font-size: 13px;
        line-height: 1.2;
        white-space: normal;
        overflow: visible;
        text-align: center;
        text-overflow: clip;
      }
      .wiki-misc-tile--artifact {
        min-height: 128px;
        padding: 9px;
        align-content: start;
      }
      .wiki-misc-tile--artifact img {
        height: 82px;
      }
      .wiki-misc-tile--artifact span {
        white-space: normal;
        overflow: visible;
        text-align: center;
        text-overflow: clip;
      }
      .wiki-misc-tile--pet {
        min-height: 128px;
        padding: 9px;
        align-content: start;
      }
      .wiki-misc-tile--pet img {
        height: 82px;
      }
      .wiki-misc-tile--pet span {
        white-space: normal;
        overflow: visible;
        text-align: center;
        text-overflow: clip;
      }
      .wiki-misc-tile--marker {
        min-height: 76px;
        padding: 6px;
      }
      .wiki-misc-tile--marker img {
        height: 38px;
      }
      .wiki-misc-tile--marker span {
        font-size: 10px;
      }
      .wiki-reader {
        display: grid;
        gap: 16px;
      }
      .wiki-reader h2 {
        margin: 0;
        font-family: Georgia, "Times New Roman", serif;
        font-size: clamp(28px, 4vw, 44px);
        line-height: 1;
      }
      .wiki-body {
        white-space: pre-wrap;
        line-height: 1.62;
        color: #3f2a13;
      }
      .wiki-font-serif { font-family: Georgia, "Times New Roman", serif; }
      .wiki-font-sans { font-family: "Trebuchet MS", "Segoe UI", ui-sans-serif, system-ui, sans-serif; }
      .wiki-font-display { font-family: Georgia, "Palatino Linotype", "Times New Roman", serif; font-weight: 850; letter-spacing: 0.01em; }
      .wiki-font-script { font-family: "Segoe Script", "Brush Script MT", cursive; }
      .wiki-font-mono { font-family: Consolas, "Courier New", monospace; }
      .wiki-font-cod { font-family: "Copperplate Gothic Bold", "Cinzel", Georgia, serif; font-weight: 900; letter-spacing: 0.03em; }
      .wiki-font-hero-king { font-family: "Hero King", Georgia, serif; }
      .wiki-font-dragon-force { font-family: "Dragon Force", Georgia, serif; }
      .wiki-font-tribal-dragon { font-family: "Tribal Dragon", Georgia, serif; }
      .wiki-size-small { font-size: 15px; }
      .wiki-size-medium { font-size: 18px; }
      .wiki-size-large { font-size: 22px; }
      .wiki-size-xlarge { font-size: 28px; }
      @media (max-width: 940px) {
        .wiki-builder { grid-template-columns: 1fr; }
        .wiki-canvas-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
        .wiki-page-canvas { width: 760px; max-width: none; }
      }
      .content { padding: 24px 20px 28px; min-width: 0; }
      .guild { display: flex; align-items: center; gap: 14px; }
      .guild, .guild > div { min-width: 0; }
      .guild h1, .guild span { overflow-wrap: anywhere; }
      .avatar {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        background: radial-gradient(circle, #facc15, #9a3412 58%, #111827);
        border: 2px solid rgba(250, 204, 21, 0.34);
        font-weight: 1000;
      }
      .avatar-img {
        width: 46px;
        height: 46px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(250, 204, 21, 0.34);
        background: #111827;
        box-shadow: 0 0 24px rgba(250, 204, 21, 0.20);
      }
      h1, h2, h3 {
        font-family: Georgia, "Times New Roman", serif;
        color: #1f1308;
        letter-spacing: 0.01em;
        text-shadow: 0 1px 0 rgba(255,255,255,0.52);
      }
      h1 { margin: 0; font-size: 24px; }
      h2 { margin: 0 0 10px; font-size: 32px; }
      h3 { margin: 0; font-size: 20px; }
      .muted { color: var(--muted); }

      .primary, .secondary, .danger, .ghost {
        border: 1px solid rgba(100, 62, 22, 0.34);
        border-radius: 8px;
        padding: 9px 13px;
        font-weight: 900;
        text-decoration: none;
        background: rgba(255, 246, 217, 0.70);
        color: #2b1706;
      }
      .primary {
        background: linear-gradient(180deg, #fff08a, #e8a938 56%, #b86a1b);
        border-color: rgba(120, 71, 16, 0.46);
        color: #241205;
        box-shadow: 0 12px 26px rgba(151, 84, 14, 0.24), inset 0 1px 0 rgba(255,255,255,0.58);
      }
      .secondary { background: rgba(88, 53, 20, 0.10); color: #5d350e; border-color: rgba(100, 62, 22, 0.30); }
      .danger { background: #6d1e19; color: #fff0dc; border-color: #9b2d24; }
      .ghost { background: transparent; }

      .hero { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; margin-bottom: 22px; }
      .hero p { margin: 0; max-width: 840px; color: var(--muted); line-height: 1.65; font-weight: 650; }
      .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

      input, select, textarea {
        width: 100%;
        border: 1px solid rgba(100, 62, 22, 0.30);
        border-radius: 8px;
        background: rgba(255, 247, 219, 0.68);
        color: var(--text);
        padding: 12px 13px;
        outline: none;
      }
      input:focus, select:focus, textarea:focus {
        border-color: rgba(250, 204, 21, 0.55);
        box-shadow: 0 0 0 3px rgba(255, 214, 90, 0.20), 0 0 18px rgba(255, 214, 90, 0.20);
      }
      textarea { min-height: 130px; resize: vertical; line-height: 1.45; }
      label { display: grid; gap: 7px; color: #4d3216; font-weight: 850; font-size: 13px; }
      .search { height: 46px; max-width: 380px; }
      .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
      .form-grid .wide { grid-column: 1 / -1; }
      .time-row {
        display: grid;
        grid-template-columns: minmax(180px, 1fr) 110px 110px;
        gap: 12px;
        align-items: end;
      }

      .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
      .stat, .card, .module-card, .table-wrap, .preview {
        background:
          radial-gradient(circle at 50% -10%, rgba(255,255,255,0.28), transparent 26%),
          linear-gradient(180deg, rgba(255, 243, 203, 0.94), rgba(222, 187, 123, 0.94)),
          var(--paper);
        border: 1px solid rgba(111, 69, 25, 0.36);
        border-radius: 8px;
        box-shadow: 0 18px 42px rgba(73, 42, 14, 0.18), inset 0 0 0 1px rgba(255,255,255,0.24), inset 0 0 28px rgba(103, 59, 18, 0.08);
      }
      .stat { padding: 17px; }
      .stat span { color: var(--muted); display: block; font-size: 13px; font-weight: 850; }
      .stat strong { display: block; margin-top: 8px; font-size: 27px; overflow-wrap: anywhere; color: #3a220c; }

      .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
      .two { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 18px; }
      .dashboard-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; margin-bottom: 16px; }
      .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
      .panel-title h3 { font-size: 21px; }
      .status-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
      .command-chip {
        border-radius: 999px;
        padding: 6px 10px;
        background: rgba(255, 69, 101, 0.14);
        color: #ff9daf;
        border: 1px solid rgba(255, 69, 101, 0.36);
        font-size: 11px;
        font-weight: 1000;
        text-transform: uppercase;
        letter-spacing: 0.08em;
      }
      .overview-panel {
        min-height: 248px;
        padding: 22px;
        overflow: hidden;
        position: relative;
        background:
          linear-gradient(180deg, rgba(255, 244, 207, 0.40), rgba(92, 50, 18, 0.20)),
          radial-gradient(circle at 62% 44%, rgba(255, 214, 90, 0.38), transparent 24%),
          radial-gradient(circle at 28% 18%, rgba(166, 82, 26, 0.18), transparent 20%),
          linear-gradient(135deg, #f1dca9, #cf9f58 65%);
        border-color: rgba(111, 69, 25, 0.42);
      }
      .overview-panel:before {
        content: "";
        position: absolute;
        inset: 54px 18px 18px;
        border: 1px solid rgba(78, 45, 15, 0.12);
        background:
          linear-gradient(rgba(78, 45, 15,0.05) 1px, transparent 1px),
          linear-gradient(90deg, rgba(78, 45, 15,0.05) 1px, transparent 1px);
        background-size: 26px 26px;
        opacity: 0.75;
        mask-image: linear-gradient(180deg, transparent, black 18%, black 80%, transparent);
      }
      .overview-content { position: relative; z-index: 1; display: grid; gap: 14px; height: 100%; align-content: end; }
      .overview-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
      .kpi-card { background: rgba(255, 247, 219, 0.54); border: 1px solid rgba(92, 55, 18, 0.18); border-radius: 10px; padding: 13px; }
      .kpi-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 1000; text-transform: uppercase; letter-spacing: 0.08em; }
      .kpi-card strong { display: block; margin-top: 7px; font-size: 22px; color: var(--text); }
      .activity-card { min-height: 248px; }
      .activity-list { display: grid; gap: 10px; }
      .activity-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 10px; background: rgba(255, 247, 219, 0.42); border: 1px solid rgba(92, 55, 18, 0.18); border-radius: 9px; }
      .activity-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(184,106,27,0.15); color: #8b3d15; border: 1px solid rgba(184,106,27,0.35); font-size: 13px; }
      .activity-item strong { display: block; font-size: 13px; line-height: 1.25; }
      .activity-time { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
      .quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
      .quick-card { min-height: 128px; display: grid; align-content: space-between; gap: 14px; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
      .quick-card:hover { transform: translateY(-2px); border-color: rgba(255, 214, 90, 0.72); box-shadow: 0 20px 44px rgba(100, 55, 17, 0.26), 0 0 20px rgba(255, 214, 90, 0.20); }
      .quick-card .big { font-size: 25px; font-weight: 1000; color: var(--text); }
      .readiness { display: grid; gap: 9px; }
      .readiness-row { display: grid; gap: 6px; }
      .readiness-row span { display: flex; justify-content: space-between; gap: 10px; color: #4d3216; font-size: 12px; font-weight: 850; }
      .bar { height: 7px; background: rgba(76, 47, 18, 0.20); border-radius: 999px; overflow: hidden; }
      .bar i { display: block; height: 100%; background: linear-gradient(90deg, #9b4d1e, var(--gold)); }
      .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
      .calendar-weekdays {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 8px;
        color: #725736;
        font-size: 11px;
        font-weight: 1000;
        letter-spacing: 0.06em;
        text-align: center;
        text-transform: uppercase;
      }
      .wiki-tag-filters,
      .wiki-card-tags,
      .wiki-editor-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .wiki-tag-filters { margin-top: 12px; }
      .wiki-tag-button,
      .wiki-tag-chip {
        min-height: 32px;
        border: 1px solid rgba(121, 82, 33, 0.28);
        border-radius: 999px;
        padding: 6px 12px;
        background: rgba(255, 248, 221, 0.72);
        color: #68491f;
        font-size: 12px;
        font-weight: 900;
      }
      .wiki-tag-button.active,
      .wiki-editor-tags .wiki-tag-button.selected {
        border-color: #d19a23;
        background: linear-gradient(180deg, #ffe88a, #e7ad2f);
        color: #3d2509;
        box-shadow: 0 4px 12px rgba(157, 99, 14, 0.2);
      }
      .wiki-card-tags { margin: 10px 0; }
      .wiki-tag-chip { min-height: 0; padding: 4px 9px; background: rgba(238, 201, 116, 0.45); }
      .wiki-tags-field small { display: block; margin-top: 6px; color: #76572f; }
      .wiki-editor-tags { margin-top: 9px; }
      .calendar-day {
        min-height: 122px;
        border: 1px solid rgba(92, 55, 18, 0.18);
        border-radius: 10px;
        background: rgba(255, 247, 219, 0.42);
        color: var(--text);
        cursor: pointer;
        font: inherit;
        padding: 10px;
        display: grid;
        gap: 8px;
        align-content: start;
        text-align: left;
        transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
      }
      .calendar-day:hover, .calendar-day:focus-visible {
        transform: translateY(-2px);
        border-color: rgba(181, 111, 26, 0.56);
        box-shadow: 0 12px 26px rgba(111, 69, 25, 0.20), 0 0 18px rgba(255, 214, 90, 0.18);
        outline: none;
      }
      .calendar-day-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; gap: 4px; }
      .calendar-day-number { justify-self: start; font-size: 18px; font-weight: 950; color: #3a220c; }
      .calendar-day-weekday { justify-self: end; color: #7b5b34; font-size: 11px; font-style: normal; font-weight: 950; text-transform: uppercase; letter-spacing: 0.05em; }
      .calendar-day-buff { justify-self: center; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 auto; }
      .calendar-day-buff img { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(72, 42, 12, 0.20)); }
      .calendar-day-buff.placeholder { visibility: hidden; }
      .calendar-day-list { display: grid; gap: 5px; min-width: 0; margin-top: auto; }
      .calendar-day-top-buff, .calendar-day-list-buff, .calendar-day-bottom-buff { display: none; }
      .calendar-entry {
        display: block;
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.34);
        border: 1px solid rgba(92, 55, 18, 0.13);
        color: #3a220c;
        font-size: 11px;
        font-weight: 900;
        line-height: 1.28;
        overflow: hidden;
        padding: 5px 6px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .calendar-entry small { display: block; color: #6e512d; font-size: 10px; font-weight: 850; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
      .calendar-entry.buff { display: inline-flex; align-items: center; justify-content: center; padding: 0; margin: 2px 0; border-radius: 0; border: 0; background: transparent; overflow: visible; }
      .calendar-entry.buff img { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(72, 42, 12, 0.20)); }
      .calendar-entry.buff small { display: none; }
      .calendar-entry:not(.buff) { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; column-gap: 6px; }
      .calendar-entry:not(.buff) img { grid-row: 1 / span 2; width: 28px; height: 28px; object-fit: contain; }
      .calendar-entry:not(.buff) span { display: block; font: 800 10px Arial, sans-serif; color: #34210f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .calendar-entry:not(.buff) small { display: block; color: #6e512d; font-size: 9px; font-weight: 850; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
      .calendar-buff-image { position: relative; display: inline-flex; cursor: pointer; }
      .calendar-buff-image img { width: 24px; height: 24px; }
      .calendar-buff-tooltip { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(120, 75, 25, 0.5); border-radius: 8px; padding: 8px; text-align: center; font: 800 11px Arial, sans-serif; color: #34210f; white-space: nowrap; z-index: 10; pointer-events: none; }
      .calendar-buff-image:hover .calendar-buff-tooltip { display: block; }
      .calendar-empty { color: var(--muted); font-size: 12px; font-weight: 850; }
      .calendar-more { color: #7c4b08; font-size: 11px; font-weight: 1000; }
      .calendar-day.hot, .calendar-day.has-items { background: linear-gradient(180deg, rgba(255, 224, 109, 0.78), rgba(209, 142, 43, 0.50)); border-color: rgba(169, 99, 23, 0.40); }
      .calendar-day.event { box-shadow: inset 0 -3px 0 rgba(179, 38, 47, 0.48); }
      .calendar-day.today {
        border-color: rgba(34, 159, 92, 0.68);
        background: linear-gradient(180deg, rgba(178, 255, 194, 0.76), rgba(103, 184, 88, 0.46));
        box-shadow: inset 0 0 0 2px rgba(34, 159, 92, 0.16), 0 0 18px rgba(34, 159, 92, 0.18);
      }
      .calendar-day.today.event { box-shadow: inset 0 0 0 2px rgba(34, 159, 92, 0.18), inset 0 -3px 0 rgba(34, 159, 92, 0.70), 0 0 18px rgba(34, 159, 92, 0.18); }
      .calendar-day.today .calendar-day-top strong {
        min-width: 30px;
        text-align: center;
        border-radius: 999px;
        padding: 3px 8px;
        color: #f9ffe8;
        background: linear-gradient(180deg, #31b36a, #11633b);
        box-shadow: 0 0 12px rgba(34, 159, 92, 0.36);
      }
      .event-calendar .calendar-day { min-height: 148px; }
      .attendance-calendar-card .event-calendar .calendar-day { min-height: 172px; }
      .calendar-detail-list { display: grid; gap: 12px; margin-top: 16px; }
      .calendar-detail-card {
        border: 1px solid rgba(92, 55, 18, 0.16);
        border-radius: 10px;
        background: rgba(255, 247, 219, 0.50);
        padding: 14px;
      }
      .calendar-detail-card h3 { font-size: 18px; margin-top: 7px; }
      .calendar-detail-card .calendar-detail-buff-icon { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(72, 42, 12, 0.20)); margin-right: 6px; vertical-align: middle; }
      .calendar-detail-card p { margin: 8px 0 0; color: #5f4729; }
      .calendar-detail-card .activity-time { margin-top: 6px; }
      .attendance-summary-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
        margin-bottom: 18px;
      }
      .attendance-summary-card {
        border: 1px solid rgba(92, 55, 18, 0.16);
        border-radius: 10px;
        background: rgba(255, 247, 219, 0.50);
        padding: 14px;
      }
      .attendance-summary-card span {
        display: block;
        color: #76552e;
        font-size: 11px;
        font-weight: 1000;
        letter-spacing: 0.08em;
        text-transform: uppercase;
      }
      .attendance-summary-card strong {
        display: block;
        margin-top: 7px;
        color: #2d1a08;
        font-size: 25px;
      }
      .attendance-focus-list { display: grid; gap: 10px; }
      .attendance-focus-item {
        display: grid;
        gap: 8px;
        border: 1px solid rgba(92, 55, 18, 0.16);
        border-radius: 10px;
        background: rgba(255, 247, 219, 0.46);
        padding: 13px;
      }
      .attendance-focus-item h4 { margin: 0; color: #2d1a08; }
      .meter { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(92, 55, 18, 0.14); }
      .meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b77912, #eab308); }
      .complaint-form-card { display: grid; gap: 14px; }
      .complaint-form-card .form-grid { margin-top: 8px; }
      .complaint-form-card .wiki-toggle-field {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        cursor: pointer;
      }
      .complaint-form-card .wiki-toggle-field input[type="checkbox"] {
        appearance: none;
        flex: 0 0 21px;
        width: 21px;
        height: 21px;
        min-width: 21px;
        margin: 0;
        padding: 0;
        border: 2px solid #79501f;
        border-radius: 5px;
        background: #fff8df;
        display: grid;
        place-items: center;
      }
      .complaint-form-card .wiki-toggle-field input[type="checkbox"]::after {
        content: "";
        width: 10px;
        height: 6px;
        border-left: 3px solid #2d1a08;
        border-bottom: 3px solid #2d1a08;
        transform: rotate(-45deg) scale(0);
        transition: transform 120ms ease;
      }
      .complaint-form-card .wiki-toggle-field input[type="checkbox"]:checked {
        background: linear-gradient(180deg, #ffe878, #d99824);
        border-color: #8b5516;
      }
      .complaint-form-card .wiki-toggle-field input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
      .complaint-form-card .wiki-toggle-field > span { line-height: 1.35; }
      .feedback-page {
        width: min(100%, 860px);
        margin: 0 auto;
      }
      .feedback-page .complaint-form-card { padding: clamp(18px, 3vw, 30px); }
      .complaint-preview {
        border: 1px dashed rgba(92, 55, 18, 0.28);
        border-radius: 10px;
        background: rgba(255, 247, 219, 0.42);
        padding: 12px;
        color: #5f4729;
        font-weight: 850;
      }
      .complaint-thumb {
        display: block;
        width: 120px;
        height: 84px;
        object-fit: cover;
        border-radius: 8px;
        border: 1px solid rgba(92, 55, 18, 0.18);
        margin-top: 8px;
      }
      .complaint-detail {
        display: grid;
        gap: 14px;
      }
      .complaint-detail-message {
        border: 1px solid rgba(92, 55, 18, 0.16);
        border-radius: 10px;
        background: rgba(255, 247, 219, 0.54);
        padding: 16px;
        color: #3a220c;
        white-space: pre-wrap;
        line-height: 1.55;
        font-weight: 750;
      }
      .complaint-detail-image {
        display: block;
        width: 100%;
        max-height: 62vh;
        object-fit: contain;
        border-radius: 12px;
        border: 1px solid rgba(92, 55, 18, 0.22);
        background: rgba(47, 27, 10, 0.10);
      }
      .complaint-detail-meta {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
      }
      .complaint-sender {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr);
        align-items: center;
        gap: 9px;
        min-width: 180px;
      }
      .complaint-sender img {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        object-fit: cover;
        border: 1px solid rgba(92, 55, 18, 0.22);
        background: rgba(255, 247, 219, 0.65);
      }
      .complaint-sender small { display: block; overflow-wrap: anywhere; }
      .alliance-stats-card { padding: 24px; }
      .metric-selector {
        margin: 0 0 16px;
        border: 1px solid rgba(106, 63, 20, 0.22);
        border-radius: 10px;
        background: rgba(255, 247, 219, 0.48);
        overflow: hidden;
      }
      .metric-selector summary {
        min-height: 48px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        color: #4d260f;
        cursor: pointer;
        list-style: none;
        font-weight: 900;
      }
      .metric-selector summary::-webkit-details-marker { display: none; }
      .metric-selector summary::after {
        content: "+";
        margin-left: auto;
        width: 28px;
        height: 28px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: rgba(198, 121, 26, 0.14);
        font-size: 20px;
        line-height: 1;
      }
      .metric-selector[open] summary::after { content: "−"; }
      .metric-selector-label {
        color: #76532f;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }
      .metric-selector-value {
        padding: 5px 10px;
        border-radius: 999px;
        background: linear-gradient(180deg, #ffec83, #c6791a);
        color: #201006;
        font-size: 11px;
        text-transform: uppercase;
      }
      .metric-picker {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        gap: 7px;
        padding: 0 12px 12px;
      }
      .metric-button {
        min-height: 38px;
        border: 1px solid rgba(106, 63, 20, 0.22);
        border-radius: 8px;
        background: rgba(53, 25, 20, 0.08);
        color: #4d260f;
        padding: 6px 7px;
        font-size: 10px;
        font-weight: 1000;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
      }
      .metric-button:hover, .metric-button:focus-visible {
        transform: translateY(-1px);
        border-color: rgba(210, 138, 30, 0.62);
        box-shadow: 0 8px 18px rgba(103, 63, 17, 0.12);
        outline: none;
      }
      .metric-button.active {
        background: linear-gradient(180deg, #ffec83, #c6791a);
        border-color: rgba(255, 240, 138, 0.94);
        color: #201006;
        box-shadow: 0 0 18px rgba(255, 214, 90, 0.36), inset 0 1px 0 rgba(255,255,255,0.55);
      }
      .profile-season-card {
        margin-top: 18px;
        border: 1px solid rgba(106, 63, 20, 0.24);
        border-radius: 12px;
        padding: clamp(14px, 3vw, 22px);
        background:
          radial-gradient(circle at 50% 42%, rgba(255, 201, 111, 0.30), transparent 48%),
          linear-gradient(180deg, rgba(255, 244, 207, 0.84), rgba(237, 203, 137, 0.72));
        overflow: hidden;
      }
      .profile-season-topbar {
        display: grid;
        grid-template-columns: minmax(132px, 1fr) auto minmax(132px, 1fr);
        align-items: start;
        gap: 12px;
        min-width: 0;
      }
      .profile-season-head { grid-column: 2; text-align: center; margin-bottom: 6px; }
      .profile-season-head h4 { margin: 0; font-size: 20px; }
      .profile-season-head p { margin: 3px 0 0; color: #76532f; font-size: 12px; font-weight: 800; }
      .profile-graph-toggle {
        grid-column: 3;
        justify-self: end;
        display: inline-grid;
        grid-template-columns: 30px auto 32px;
        align-items: center;
        gap: 7px;
        min-height: 42px;
        max-width: 168px;
        border: 1px solid rgba(122, 73, 18, 0.34);
        border-radius: 999px;
        padding: 5px 8px 5px 5px;
        background: linear-gradient(180deg, rgba(255, 246, 211, 0.96), rgba(224, 188, 115, 0.92));
        color: #4d2a12;
        box-shadow: 0 5px 14px rgba(95, 54, 13, 0.14), inset 0 1px 0 rgba(255,255,255,0.72);
        cursor: pointer;
        transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
      }
      .profile-graph-toggle:hover, .profile-graph-toggle:focus-visible {
        transform: translateY(-1px);
        border-color: rgba(177, 105, 14, 0.72);
        box-shadow: 0 8px 18px rgba(95, 54, 13, 0.20), 0 0 0 3px rgba(255, 220, 94, 0.24);
        outline: none;
      }
      .profile-graph-toggle img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
      .profile-graph-toggle-copy { display: grid; gap: 1px; min-width: 0; text-align: left; line-height: 1.05; }
      .profile-graph-toggle-copy strong { font-size: 10px; white-space: nowrap; }
      .profile-graph-toggle-copy small { color: #7c5732; font-size: 9px; font-weight: 800; }
      .profile-graph-switch { position: relative; width: 32px; height: 18px; border-radius: 999px; background: rgba(89, 55, 23, 0.25); box-shadow: inset 0 1px 3px rgba(65, 35, 10, 0.24); transition: background 160ms ease; }
      .profile-graph-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff4cf; box-shadow: 0 1px 4px rgba(59, 29, 5, 0.34); transition: transform 180ms ease; }
      .profile-graph-toggle.active .profile-graph-switch { background: linear-gradient(90deg, #b66e12, #f0b93e); }
      .profile-graph-toggle.active .profile-graph-switch::after { transform: translateX(14px); }
      .profile-radar { display: block; width: min(100%, 640px); height: auto; margin: 2px auto 0; overflow: visible; }
      .radar-ring { fill: none; stroke: rgba(112, 72, 31, 0.22); stroke-width: 1; }
      .radar-axis { stroke: rgba(112, 72, 31, 0.22); stroke-width: 1; }
      .radar-area { fill: rgba(255, 91, 67, 0.57); stroke: #e65e40; stroke-width: 2.5; }
      .radar-area, .radar-dot { transform-box: fill-box; transform-origin: center; animation: radar-grow 360ms ease-out; }
      .radar-dot { fill: #ff7658; stroke: #fff0c7; stroke-width: 2; }
      .radar-label { fill: #604523; font-size: 13px; font-weight: 900; }
      .radar-value { fill: #9a4b28; font-size: 10px; font-weight: 900; }
      .profile-radar-controls { display: grid; gap: 10px; margin-top: 10px; }
      .profile-radar-controls details { margin: 0; }
      .profile-radar-controls .metric-picker { padding-top: 2px; }
      .profile-radar-snapshots { display: grid; gap: 7px; min-width: 0; }
      .profile-radar-snapshots-label { color: #76532f; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }
      .profile-radar-dates { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; min-width: 0; }
      .profile-radar-date { flex: 0 0 auto; min-width: 54px; min-height: 34px; border-radius: 999px; padding: 6px 11px; font-size: 10px; font-weight: 900; cursor: pointer; pointer-events: auto; touch-action: manipulation; }
      .profile-radar-date:hover, .profile-radar-date:focus-visible { border-color: #bd7618; box-shadow: 0 5px 12px rgba(115, 67, 15, 0.18); outline: none; }
      .profile-radar-date.active { background: linear-gradient(180deg, #fff3a2, #d88a20); border-color: #94500a; color: #201006; box-shadow: 0 0 0 3px rgba(255, 224, 87, 0.76), 0 7px 16px rgba(116, 67, 13, 0.30); animation: snapshot-selected 280ms ease-out; }
      .profile-radar-date-select-shell { display: none; }
      .profile-radar-date-select {
        width: 100%;
        min-height: 44px;
        border: 1px solid rgba(134, 81, 20, 0.42);
        border-radius: 10px;
        padding: 9px 38px 9px 12px;
        background: linear-gradient(180deg, #fff4ce, #e9c77f);
        color: #3f260e;
        font: inherit;
        font-size: 14px;
        font-weight: 900;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 5px 14px rgba(101, 61, 16, 0.12);
      }
      .profile-trend-chart { display: grid; gap: 10px; width: min(100%, 640px); margin: 4px auto 0; }
      .profile-trend-summary { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 0 24px; color: #684420; }
      .profile-trend-summary span { display: grid; gap: 1px; }
      .profile-trend-summary small { color: #8a633d; font-size: 10px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
      .profile-trend-summary strong { font-size: clamp(20px, 4vw, 30px); }
      .profile-trend-change { border-radius: 999px; padding: 6px 11px; background: rgba(110, 72, 31, 0.09); font-size: 12px; font-weight: 900; }
      .profile-trend-change.positive { background: rgba(76, 151, 77, 0.16); color: #246834; }
      .profile-trend-change.negative { background: rgba(181, 65, 52, 0.13); color: #9c3329; }
      .profile-trend-svg { display: block; width: 100%; height: auto; overflow: visible; }
      .profile-trend-grid { stroke: rgba(112, 72, 31, 0.17); stroke-width: 1; }
      .profile-trend-axis-label { fill: #8a633d; font-size: 10px; font-weight: 800; }
      .profile-trend-area { fill: url(#profileTrendFill); }
      .profile-trend-line { fill: none; stroke: #aa5b18; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
      .profile-trend-dot { fill: #f3b73f; stroke: #77400e; stroke-width: 2; cursor: pointer; transition: r 140ms ease, fill 140ms ease; }
      .profile-trend-dot:hover { r: 6; fill: #fff0a4; }
      .profile-trend-dot.active { fill: #ff6b4c; stroke: #fff1c1; stroke-width: 3; animation: snapshot-selected 280ms ease-out; }
      .profile-trend-empty { display: grid; place-items: center; min-height: 230px; border: 1px dashed rgba(106, 63, 20, 0.28); border-radius: 12px; color: #7b5b38; font-weight: 800; text-align: center; }
      .profile-edit-button { margin-top: 9px; min-height: 30px; padding: 5px 11px; font-size: 11px; }
      .admin-profile-editor { position: fixed; inset: 0; z-index: 4; display: none; align-items: center; justify-content: center; padding: 24px; }
      .admin-profile-editor.open { display: flex; }
      .admin-profile-editor-backdrop { position: absolute; inset: 0; background: rgba(35, 19, 7, 0.66); backdrop-filter: blur(4px); }
      .admin-profile-editor-panel { position: relative; width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 42px); overflow: auto; border: 1px solid rgba(106, 63, 20, 0.38); border-radius: 12px; padding: 18px; background: linear-gradient(180deg, #fff1c5, #e6be78); box-shadow: 0 28px 80px rgba(0,0,0,0.48); }
      .admin-profile-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
      .admin-profile-editor-avatar { display: flex; justify-content: center; margin-bottom: 12px; }
      @keyframes radar-grow { from { opacity: 0.2; transform: scale(0.55); } to { opacity: 1; transform: scale(1); } }
      @keyframes snapshot-selected { from { transform: scale(0.88); } 65% { transform: scale(1.08); } to { transform: scale(1); } }
      .power-list { display: grid; gap: 12px; }
      .power-trend-row {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(190px, 1fr) minmax(280px, 1.8fr) auto;
        gap: 18px;
        align-items: center;
        border: 1px solid rgba(120, 73, 24, 0.20);
        border-radius: 10px;
        background: linear-gradient(180deg, rgba(255, 247, 219, 0.58), rgba(227, 188, 111, 0.24));
        padding: 14px 16px;
        color: #311d0a;
        text-align: left;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.42);
      }
      .power-trend-row.top-stat-player {
        border-color: rgba(32, 143, 79, 0.42);
        background: linear-gradient(180deg, rgba(222, 255, 218, 0.44), rgba(247, 219, 138, 0.40));
        box-shadow: inset 4px 0 0 rgba(32, 143, 79, 0.70), inset 0 1px 0 rgba(255,255,255,0.48);
      }
      .power-trend-row:hover, .power-trend-row:focus {
        transform: translateY(-1px);
        border-color: rgba(190, 123, 24, 0.45);
        box-shadow: 0 12px 24px rgba(103, 63, 17, 0.14), inset 0 1px 0 rgba(255,255,255,0.45);
        outline: none;
      }
      .power-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
      .power-player .member-avatar { width: 48px; height: 48px; box-shadow: 0 0 18px rgba(170, 103, 18, 0.14); }
      .power-player-info { min-width: 0; }
      .power-player strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .power-player span { display: block; margin-top: 4px; color: #76552e; font-size: 12px; font-weight: 900; }
      .stat-rank {
        display: inline-flex;
        width: max-content;
        margin-bottom: 7px;
        border-radius: 999px;
        padding: 3px 8px;
        background: rgba(32, 143, 79, 0.14);
        color: #11633b;
        border: 1px solid rgba(32, 143, 79, 0.25);
        font-size: 10px;
        font-weight: 1000;
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }
      .power-spark-wrap { display: grid; gap: 4px; min-width: 0; }
      .power-sparkline {
        width: 100%;
        height: 72px;
        border-radius: 8px;
        background: linear-gradient(180deg, rgba(255, 246, 208, 0.58), rgba(205, 144, 45, 0.20));
        border: 1px solid rgba(110, 69, 24, 0.14);
      }
      .power-sparkline .grid-line { stroke: rgba(110, 69, 24, 0.14); stroke-width: 1; }
      .power-sparkline .spark-fill { fill: rgba(185, 107, 28, 0.16); }
      .power-sparkline .spark-line { fill: none; stroke: #9b4c0e; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(255, 214, 90, 0.34)); }
      .power-sparkline .spark-dot { fill: #fff2a8; stroke: #8e430c; stroke-width: 2; }
      .power-sparkline .chart-label { fill: #6e512d; font-size: 10px; font-weight: 900; }
      .power-sparkline .chart-latest { fill: #3a220c; font-size: 11px; font-weight: 1000; }
      .power-spark-meta { color: #795a35; font-size: 11px; font-weight: 900; }
      .trend-pill {
        justify-self: end;
        min-width: 94px;
        border-radius: 999px;
        padding: 8px 10px;
        text-align: center;
        font-size: 12px;
        font-weight: 1000;
        border: 1px solid rgba(92, 55, 18, 0.16);
        background: rgba(255, 247, 219, 0.58);
      }
      .trend-pill.up { color: #12643d; background: rgba(72, 173, 93, 0.18); }
      .trend-pill.down { color: #8f1f22; background: rgba(179, 38, 47, 0.14); }
      .trend-pill.flat { color: #6b502f; }
      .member-power-chart {
        margin-top: 14px;
        border: 1px solid rgba(98, 62, 24, 0.20);
        border-radius: 10px;
        background: linear-gradient(180deg, rgba(255, 247, 219, 0.64), rgba(219, 171, 91, 0.28));
        padding: 14px;
      }
      .member-power-chart-head {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: flex-start;
        margin-bottom: 12px;
      }
      .member-power-chart h4 { margin: 0; font-size: 18px; }
      .member-power-chart p { margin: 4px 0 0; color: #6d512f; font-weight: 850; }
      .member-power-chart svg { display: block; width: 100%; height: 190px; }
      .power-history-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
      .power-history-list span { border: 1px solid rgba(98, 62, 24, 0.14); border-radius: 8px; padding: 8px 10px; background: rgba(255,247,219,0.44); font-weight: 900; color: #4d3216; }
      .interactive-chart {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(180px, 0.42fr);
        gap: 12px;
        align-items: stretch;
      }
      .interactive-chart .power-sparkline { height: 210px; }
      .chart-point {
        fill: #fff2a8;
        stroke: #8e430c;
        stroke-width: 2.4;
        cursor: pointer;
        transition: r 140ms ease, filter 140ms ease, fill 140ms ease;
      }
      .chart-point:hover,
      .chart-point.selected {
        r: 6;
        fill: #4ff0aa;
        filter: drop-shadow(0 0 7px rgba(79, 240, 170, 0.72));
      }
      .chart-detail {
        border: 1px solid rgba(98, 62, 24, 0.18);
        border-radius: 10px;
        padding: 13px;
        background: rgba(255,247,219,0.48);
        display: grid;
        align-content: center;
        gap: 7px;
        color: #4d3216;
        font-weight: 900;
      }
      .chart-detail span { color: #725736; font-size: 12px; font-weight: 850; }
      .upload-comparison {
        margin-top: 12px;
        display: grid;
        gap: 8px;
      }
      .upload-comparison-row {
        display: grid;
        grid-template-columns: minmax(112px, 0.7fr) minmax(90px, 0.6fr) minmax(90px, 0.6fr) minmax(92px, 0.7fr);
        gap: 10px;
        align-items: center;
        border: 1px solid rgba(98, 62, 24, 0.14);
        border-radius: 8px;
        padding: 8px 10px;
        background: rgba(255,247,219,0.42);
        color: #4d3216;
        font-size: 12px;
        font-weight: 900;
        text-align: left;
      }
      .upload-comparison-row:hover,
      .upload-comparison-row.selected {
        border-color: rgba(32, 143, 79, 0.32);
        background: rgba(222, 255, 218, 0.30);
      }
      .upload-comparison-row small { display: block; margin-top: 3px; color: #80613a; font-weight: 800; }
      .upload-comparison-row strong { color: #2d1a08; }
      .upload-comparison-row strong.up { color: #12643d; }
      .upload-comparison-row strong.down { color: #8f1f22; }
      .upload-comparison-row strong.flat { color: #6b502f; }
      .account-link-note {
        margin-top: 14px;
        border: 1px solid rgba(32, 143, 79, 0.25);
        border-radius: 10px;
        background: rgba(222, 255, 218, 0.34);
        padding: 12px 14px;
        color: #31531e;
        font-weight: 900;
      }
      .farm-grid {
        margin-top: 12px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 10px;
      }
      .farm-card {
        border: 1px solid rgba(98, 62, 24, 0.18);
        border-radius: 10px;
        background: rgba(255, 247, 219, 0.50);
        padding: 12px;
        color: #3a220c;
        display: grid;
        gap: 9px;
        text-align: left;
      }
      .farm-card:hover, .farm-card:focus {
        border-color: rgba(190, 123, 24, 0.46);
        box-shadow: 0 10px 20px rgba(103, 63, 17, 0.12);
        outline: none;
      }
      .farm-card-head { display: flex; align-items: center; gap: 10px; }
      .farm-card-head .member-avatar { width: 42px; height: 42px; }
      .farm-card h4 { margin: 0; font-size: 15px; }
      .farm-card small { color: #725736; font-weight: 850; }
      .farm-stats { display: flex; flex-wrap: wrap; gap: 8px; }
      .farm-stats span {
        border-radius: 999px;
        background: rgba(92, 55, 18, 0.10);
        border: 1px solid rgba(92, 55, 18, 0.12);
        padding: 5px 8px;
        color: #5d350e;
        font-size: 11px;
        font-weight: 1000;
      }
      .farm-picker {
        display: grid;
        gap: 8px;
      }
      .farm-picker-selected {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        border: 1px solid rgba(32, 143, 79, 0.26);
        border-radius: 8px;
        background: rgba(222, 255, 218, 0.30);
        color: #31531e;
        padding: 8px 10px;
        font-size: 12px;
        font-weight: 1000;
      }
      .farm-picker-selected button {
        border: 0;
        background: transparent;
        color: #8f1f22;
        font-weight: 1000;
        padding: 0;
      }
      .farm-search-results {
        display: grid;
        gap: 6px;
        max-height: 220px;
        overflow: auto;
        border-radius: 8px;
      }
      .farm-search-result {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 10px;
        border: 1px solid rgba(98, 62, 24, 0.16);
        border-radius: 8px;
        background: rgba(255, 247, 219, 0.48);
        color: #3a220c;
        padding: 8px 10px;
        text-align: left;
      }
      .farm-search-result:hover,
      .farm-search-result:focus {
        border-color: rgba(190, 123, 24, 0.46);
        background: rgba(255, 214, 90, 0.18);
        outline: none;
      }
      .farm-search-result .member-avatar { width: 34px; height: 34px; }
      .farm-search-result strong { display: block; font-size: 13px; }
      .farm-search-result span span { display: block; margin-top: 2px; color: #76552e; font-size: 11px; font-weight: 850; }
      .command-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
      .command-card { padding: 14px; border: 1px solid rgba(92, 55, 18, 0.18); border-radius: 10px; background: rgba(255, 247, 219, 0.48); }
      .command-card code { display: inline-block; margin-bottom: 8px; font-weight: 1000; color: #8b3d15; }
      .tool-picker { display: grid; gap: 14px; max-width: 420px; }
      .card, .preview { padding: 20px; }
      .card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
      .card p { color: #5f4729; line-height: 1.55; font-weight: 650; }

      .module-card { min-height: 168px; padding: 21px 19px; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
      .module-card:hover { transform: translateY(-2px); border-color: rgba(255, 214, 90, 0.72); box-shadow: 0 22px 44px rgba(100,55,17,0.28), 0 0 18px rgba(255,214,90,0.18); }
      .module-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
      .meta { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
      .meta span, .meta strong, .badge {
        border-radius: 5px;
        padding: 5px 8px;
        font-size: 12px;
        font-weight: 1000;
      }
      .meta span { background: rgba(92, 55, 18, 0.12); color: #5d350e; border: 1px solid rgba(92,55,18,0.12); }
      .meta strong, .badge.good { background: rgba(18, 122, 70, 0.13); color: #16603d; }
      .badge.warn { background: rgba(255, 214, 90, 0.24); color: #7c4b08; }
      .badge.bad { background: rgba(179, 38, 47, 0.12); color: #8c1d22; }
      .module-card p { min-height: 58px; color: #5f4729; line-height: 1.45; font-weight: 700; }

      .switch {
        width: 52px;
        height: 26px;
        border: 0;
        border-radius: 999px;
        background: rgba(83, 49, 18, 0.20);
        padding: 3px;
        flex: 0 0 auto;
      }
      .switch i { display: block; width: 20px; height: 20px; border-radius: 50%; background: #8c6b41; }
      .switch.on i { margin-left: auto; background: linear-gradient(135deg, #ffe88a, #b96b1c); box-shadow: 0 0 18px rgba(255, 214, 90, 0.42); }
      .optional-link-button {
        padding: 14px;
        border: 1px solid rgba(92, 55, 18, 0.20);
        border-radius: 8px;
        background: rgba(255, 248, 218, 0.42);
      }
      .optional-link-button-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 12px;
      }
      .optional-link-button-head strong { display: block; }
      .optional-link-button-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
      .optional-link-button-fields { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 12px; }
      .optional-link-button-fields input:disabled { opacity: 0.55; cursor: not-allowed; }
      .command-settings { margin-top: 18px; }
      .command-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
      .command-setting {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 13px 14px;
        border: 1px solid rgba(92, 55, 18, 0.20);
        border-radius: 8px;
        background: rgba(255, 247, 219, 0.46);
      }
      .command-setting strong { display: block; color: #3f250e; }
      .command-setting small { display: block; margin-top: 3px; color: #775a36; line-height: 1.35; }
      .command-setting .switch:disabled { cursor: not-allowed; opacity: 0.5; }
      .module-actions { display: flex; gap: 10px; align-items: center; }
      .module-actions button {
        border: 0;
        border-radius: 5px;
        background: rgba(255, 238, 183, 0.62);
        color: #5d350e;
        padding: 9px 12px;
        font-weight: 1000;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
      }

      table { width: 100%; border-collapse: collapse; min-width: 760px; }
      th, td { padding: 14px 16px; border-bottom: 1px solid rgba(98, 62, 24, 0.20); text-align: left; vertical-align: top; }
      th { color: #5d350e; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(210, 162, 83, 0.28); }
      td { color: #2b1706; }
      .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
      }
      .table-wrap table { margin: 0; }
      tbody tr { transition: background 150ms ease, transform 150ms ease; }

      .empty, .error, .skeleton {
        border: 1px dashed rgba(100, 62, 22, 0.42);
        border-radius: 10px;
        padding: 28px;
        color: var(--muted);
        background: rgba(255, 247, 219, 0.38);
        text-align: center;
        font-weight: 800;
      }
      .error { border-color: #9b2d24; color: #7a1715; }
      .locked-note {
        margin-bottom: 16px;
        border: 1px solid rgba(250, 204, 21, 0.32);
        background: rgba(255, 224, 126, 0.22);
        color: #5d350e;
        border-radius: 10px;
        padding: 13px 15px;
        font-weight: 850;
      }
      .skeleton { position: relative; overflow: hidden; min-height: 160px; }
      .skeleton:after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
        animation: shimmer 1.2s infinite;
      }
      @keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
      @keyframes spin { to { transform: rotate(360deg); } }
      .spinner {
        display: inline-block;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border: 2px solid currentColor;
        border-right-color: transparent;
        animation: spin 700ms linear infinite;
        vertical-align: -2px;
        margin-right: 7px;
      }

      .list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
      .list li { background: rgba(255, 247, 219, 0.42); border: 1px solid var(--line); border-radius: 7px; padding: 12px 14px; }
      .member-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
      .member-avatar {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        object-fit: cover;
        background: linear-gradient(135deg, #f4db9d, #ba7b2c);
        border: 1px solid rgba(92, 55, 18, 0.36);
        color: #2b1706;
        font-weight: 1000;
      }
      .member-name { display: block; font-weight: 1000; color: var(--text); }
      .member-username { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 800; }
      .member-row { cursor: pointer; }
      .member-row:hover, .member-row:focus {
        background: rgba(255, 214, 90, 0.16);
        outline: none;
      }
      .member-row:focus-visible { box-shadow: inset 3px 0 0 var(--gold); }
      .players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
      .attendance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
      .attendance-group {
        border: 1px solid rgba(98, 62, 24, 0.25);
        border-radius: 9px;
        background: rgba(255, 247, 219, 0.38);
        padding: 12px;
      }
      .attendance-group h4 { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 10px; font-size: 14px; }
      .attendance-group ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
      .attendance-group li { border-bottom: 1px solid rgba(98, 62, 24, 0.14); padding-bottom: 7px; font-weight: 850; }
      .attendance-group li:last-child { border-bottom: 0; padding-bottom: 0; }
      .attendance-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
      .attendance-detail-head h3 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 44px); }
      .attendance-total { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
      .stack { display: grid; gap: 14px; }
      .preview {
        border-left: 5px solid #b96b1c;
        min-height: 220px;
      }
      .preview h3 { margin-bottom: 12px; }
      .preview .image { display: none; margin-top: 14px; width: 100%; border-radius: 8px; border: 1px solid var(--line); }
      .preview .thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); float: right; display: none; margin-left: 12px; }
      .preview footer { margin-top: 16px; color: var(--muted); font-size: 13px; }
      .preview-link-button {
        display: none;
        width: fit-content;
        margin-top: 14px;
        padding: 9px 15px;
        border-radius: 999px;
        background: #5865f2;
        color: white;
        font: inherit;
        font-weight: 900;
        text-decoration: none;
        pointer-events: none;
      }

      .toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); }
      .toast { border: 1px solid rgba(100, 62, 22, 0.40); background: #fff0c6; color: #241509; border-radius: 9px; padding: 13px 14px; box-shadow: 0 18px 40px rgba(0,0,0,0.35); font-weight: 750; }
      .toast.success { border-color: rgba(92,255,200,0.35); }
      .toast.error { border-color: rgba(255,79,98,0.5); }
      .kofi-tip {
        position: fixed;
        right: 22px;
        bottom: 22px;
        z-index: 40;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        border: 1px solid rgba(255,255,255,0.45);
        border-radius: 999px;
        padding: 10px 16px 10px 10px;
        background: linear-gradient(135deg, #00b9fe, #018bd8);
        color: #fff;
        font-weight: 1000;
        text-decoration: none;
        box-shadow: 0 18px 38px rgba(0, 185, 254, 0.32), 0 0 0 3px rgba(255,255,255,0.12);
        transition: transform 160ms ease, box-shadow 160ms ease;
      }
      .kofi-tip:hover { transform: translateY(-2px); box-shadow: 0 22px 44px rgba(0, 185, 254, 0.42), 0 0 0 4px rgba(255,255,255,0.16); }
      .kofi-tip img { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.20); }

      .member-modal {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 18px;
      }
      body.modal-open { overflow: hidden; }
      .member-modal.open { display: flex; }
      .member-modal-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(20, 12, 6, 0.72);
        backdrop-filter: blur(8px);
      }
      .member-modal-panel {
        position: relative;
        z-index: 1;
        width: min(720px, calc(100vw - 28px));
        max-height: calc(100vh - 36px);
        overflow: auto;
        border-radius: 12px;
        border: 1px solid rgba(111, 69, 25, 0.42);
        background:
          radial-gradient(circle at 50% -12%, rgba(255,255,255,0.32), transparent 28%),
          linear-gradient(180deg, rgba(255, 243, 203, 0.98), rgba(216, 178, 106, 0.98)),
          var(--paper);
        box-shadow: 0 35px 110px rgba(0, 0, 0, 0.66), inset 0 1px 0 rgba(255,255,255,0.07);
        padding: 22px;
      }
      .member-modal.wiki-modal .member-modal-panel {
        width: min(940px, calc(100vw - 28px));
      }
      .modal-close {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        border: 1px solid rgba(250, 204, 21, 0.18);
        background: rgba(92, 55, 18, 0.12);
        color: #4a2b10;
        font-size: 20px;
        line-height: 1;
      }
      .member-profile-hero {
        display: grid;
        grid-template-columns: 92px 1fr;
        gap: 18px;
        align-items: center;
        padding-right: 42px;
      }
      .profile-avatar {
        width: 92px;
        height: 92px;
        border-radius: 22px;
        display: grid;
        place-items: center;
        object-fit: cover;
        border: 1px solid rgba(250, 204, 21, 0.42);
        background: radial-gradient(circle, rgba(250, 204, 21, 0.22), rgba(255, 77, 117, 0.14) 56%, rgba(15, 23, 42, 0.92));
        box-shadow: 0 0 34px rgba(250, 204, 21, 0.16);
        color: #fff7d6;
        font-size: 34px;
        font-weight: 1000;
      }
      .avatar-button {
        position: relative;
        width: 92px;
        height: 92px;
        border: 0;
        border-radius: 22px;
        padding: 0;
        background: transparent;
        cursor: pointer;
      }
      .avatar-button .profile-avatar {
        width: 100%;
        height: 100%;
      }
      .avatar-button::after {
        content: "Upload";
        position: absolute;
        inset: auto 8px 8px;
        border-radius: 999px;
        padding: 5px 8px;
        background: rgba(58, 34, 12, 0.84);
        color: #fff7d6;
        font-size: 10px;
        font-weight: 1000;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        opacity: 0;
        transform: translateY(4px);
        transition: 0.18s ease;
      }
      .avatar-button:hover::after,
      .avatar-button:focus-visible::after {
        opacity: 1;
        transform: translateY(0);
      }
      .avatar-button:focus-visible {
        outline: 3px solid rgba(250, 204, 21, 0.7);
        outline-offset: 4px;
      }
      .profile-kicker { color: var(--gold-soft); text-transform: uppercase; letter-spacing: 0.11em; font-size: 11px; font-weight: 1000; }
      .member-profile-hero h3 { margin-top: 4px; font-size: 28px; }
      .profile-subtitle { color: #6d512f; font-weight: 800; margin-top: 5px; }
      .profile-stats {
        margin-top: 20px;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
      }
      .profile-stat {
        border: 1px solid rgba(250, 204, 21, 0.13);
        border-radius: 8px;
        padding: 13px;
        background: rgba(255, 247, 219, 0.46);
      }
      .profile-stat span { color: #725736; display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 1000; }
      .profile-stat strong { display: block; margin-top: 6px; color: #3a220c; font-size: 17px; overflow-wrap: anywhere; }
      .profile-note {
        margin-top: 14px;
        border: 1px solid rgba(250, 204, 21, 0.13);
        border-radius: 8px;
        padding: 14px;
        background: rgba(255, 247, 219, 0.46);
        color: #4d3216;
        line-height: 1.55;
        font-weight: 700;
      }
      .power-meter {
        margin-top: 16px;
        height: 9px;
        border-radius: 999px;
        background: rgba(255,255,255,0.08);
        overflow: hidden;
      }
      .power-meter i {
        display: block;
        height: 100%;
        width: var(--power-width, 0%);
        background: linear-gradient(90deg, #ff4d75, #ff7438, #facc15);
        box-shadow: 0 0 18px rgba(250, 204, 21, 0.28);
      }
      .avatar-cropper {
        position: fixed;
        inset: 0;
        z-index: 80;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 18px;
      }
      .avatar-cropper.open { display: flex; }
      .avatar-cropper-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(20, 12, 6, 0.76);
        backdrop-filter: blur(8px);
      }
      .avatar-cropper-panel {
        position: relative;
        z-index: 1;
        width: min(460px, calc(100vw - 28px));
        border: 1px solid rgba(111, 69, 25, 0.42);
        border-radius: 12px;
        background:
          radial-gradient(circle at 50% -10%, rgba(255,255,255,0.36), transparent 28%),
          linear-gradient(180deg, rgba(255, 243, 203, 0.99), rgba(222, 184, 110, 0.99)),
          var(--paper);
        box-shadow: 0 35px 110px rgba(0, 0, 0, 0.68);
        padding: 22px;
      }
      .avatar-crop-frame {
        --avatar-zoom: 1;
        width: min(340px, calc(100vw - 84px));
        aspect-ratio: 1 / 1;
        margin: 18px auto 14px;
        overflow: hidden;
        border-radius: 28px;
        border: 2px solid rgba(250, 204, 21, 0.52);
        background: radial-gradient(circle, rgba(250, 204, 21, 0.20), rgba(45, 24, 8, 0.84));
        box-shadow: inset 0 0 32px rgba(0,0,0,0.26), 0 18px 42px rgba(70, 37, 9, 0.22);
      }
      .avatar-crop-frame img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scale(var(--avatar-zoom));
        transform-origin: center;
        transition: transform 0.12s ease;
      }
      .avatar-crop-controls {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 10px;
        align-items: center;
      }
      .avatar-crop-controls input[type="range"] {
        width: 100%;
        accent-color: #d99a12;
      }
      .avatar-crop-actions {
        margin-top: 16px;
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        flex-wrap: wrap;
      }
      .avatar-zoom-readout {
        color: #6d512f;
        font-size: 12px;
        font-weight: 1000;
        text-align: center;
        text-transform: uppercase;
        letter-spacing: 0.08em;
      }

      .lord-tools-shell { display: grid; gap: 16px; }
      .profile-hub-nav { display: flex; gap: 8px; padding: 7px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(231, 207, 151, 0.52); scrollbar-width: thin; }
      .profile-hub-nav button { flex: 0 0 auto; min-height: 42px; padding: 9px 15px; border: 1px solid rgba(122, 79, 27, 0.24); background: rgba(255, 249, 226, 0.82); color: #5b3817; font-size: 12px; font-weight: 1000; }
      .profile-hub-nav button.active { border-color: #b4760f; background: linear-gradient(180deg, #f8d96c, #e9ad29); color: #291500; box-shadow: inset 0 1px rgba(255,255,255,0.62), 0 4px 12px rgba(124, 69, 8, 0.18); }
      .profile-hub-nav + .two { margin-top: 16px; }
      .lord-intro { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 247, 215, 0.74); }
      .lord-intro > img { width: 76px; height: 76px; padding: 8px; object-fit: contain; border: 1px solid rgba(156, 100, 22, 0.34); border-radius: 50%; background: #16263e; }
      .lord-intro h3 { margin: 0 0 5px; font-size: 25px; }
      .lord-intro p { margin: 0; color: var(--muted); }
      .lord-save-state { display: grid; gap: 4px; text-align: right; color: var(--muted); font-size: 12px; font-weight: 900; }
      .lord-navigation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 250px); gap: 10px; align-items: center; }
      .lord-tabs { display: flex; gap: 7px; min-width: 0; padding: 7px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(231, 207, 151, 0.56); scrollbar-width: thin; }
      .lord-tab { flex: 0 0 auto; min-height: 40px; padding: 8px 13px; border: 1px solid rgba(122, 79, 27, 0.26); background: rgba(255, 249, 226, 0.82); color: #5b3817; font-size: 12px; font-weight: 1000; }
      .lord-tab.active { border-color: #b4760f; background: #efbd3f; color: #291500; box-shadow: inset 0 1px rgba(255,255,255,0.55), 0 4px 12px rgba(124, 69, 8, 0.18); }
      .lord-view-select { min-height: 54px; border-color: rgba(139, 91, 23, 0.42); background: rgba(255, 249, 226, 0.9); color: #4f3014; font-weight: 1000; }
      .lord-panel { display: grid; gap: 16px; }
      .lord-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
      .lord-summary-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 249, 224, 0.72); }
      .lord-summary-card span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 1000; letter-spacing: 0.08em; text-transform: uppercase; }
      .lord-summary-card strong { display: block; font-size: clamp(20px, 2.5vw, 30px); line-height: 1; overflow-wrap: anywhere; }
      .lord-progress { height: 8px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: rgba(107, 67, 23, 0.16); }
      .lord-progress i { display: block; width: var(--lord-progress, 0%); height: 100%; border-radius: inherit; background: #c78414; transition: width 0.22s ease; }
      .lord-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
      .lord-section-heading h3 { margin: 0; }
      .lord-section-heading p { margin: 4px 0 0; color: var(--muted); }
      .lord-tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
      .lord-tool-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 118px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 249, 224, 0.72); color: var(--text); text-align: left; }
      .lord-tool-card:hover { border-color: #b77912; transform: translateY(-1px); }
      .lord-tool-card img { width: 52px; height: 52px; object-fit: contain; }
      .lord-tool-card strong { display: block; margin-bottom: 4px; font-size: 17px; }
      .lord-tool-card span { color: var(--muted); font-size: 13px; line-height: 1.45; }
      .lord-form { padding: 18px; }
      .lord-form .form-grid { align-items: start; }
      .lord-form label > small { display: block; margin-top: 5px; color: var(--muted); font-weight: 700; line-height: 1.35; }
      .lord-table { min-width: 760px; }
      .lord-table th:first-child, .lord-table td:first-child { position: sticky; left: 0; z-index: 1; background: #f1dba4; }
      .lord-table input { min-width: 92px; text-align: right; }
      .lord-speedups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
      .lord-speedup-card { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 249, 224, 0.72); }
      .lord-speedup-card img { width: 46px; height: 46px; object-fit: contain; }
      .lord-speedup-card input { font-size: 24px; font-weight: 1000; }
      .lord-catalog-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; align-items: center; }
      .lord-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
      .lord-catalog-card { display: grid; gap: 11px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 249, 224, 0.72); }
      .lord-catalog-card.hidden { display: none; }
      .lord-catalog-head { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
      .lord-catalog-head img { width: 52px; height: 52px; border-radius: 7px; object-fit: cover; background: rgba(81, 48, 15, 0.1); }
      .lord-catalog-head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .lord-catalog-head small { color: var(--muted); }
      .lord-catalog-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
      .lord-skill-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
      .lord-skill-row input { min-width: 0; padding: 8px 4px; text-align: center; }
      .lord-pill { min-height: 34px; padding: 6px 10px; border: 1px solid rgba(115, 72, 24, 0.26); border-radius: 999px; background: rgba(239, 220, 174, 0.66); color: #68421c; font-size: 11px; font-weight: 1000; }
      .lord-pill.on { border-color: #418857; background: #d9edc6; color: #1e6539; }
      .lord-pairings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
      .lord-pair-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 249, 224, 0.72); }
      .lord-pair-card h4 { margin: 0 0 12px; font-size: 19px; }
      .lord-pet-preview { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; align-items: center; }
      .lord-pet-preview img { width: 110px; height: 110px; object-fit: contain; }
      .lord-calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
      .lord-calc-card { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 249, 224, 0.72); }
      .lord-calc-card h3 { margin: 0 0 4px; }
      .lord-calc-card > p { margin: 0 0 14px; color: var(--muted); }
      .lord-calc-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 8px; margin-top: 12px; }
      .lord-calc-results div { min-width: 0; padding: 10px; border: 1px solid rgba(119, 77, 26, 0.18); border-radius: 7px; background: rgba(239, 216, 160, 0.44); }
      .lord-calc-results span { display: block; color: var(--muted); font-size: 9px; font-weight: 1000; text-transform: uppercase; }
      .lord-calc-results strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
      .lord-calc-results .lord-calc-resource { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
      .lord-calc-resource img { grid-row: 1 / 3; width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(67, 41, 15, .24)); }
      .lord-research-workspace { overflow: hidden; border: 1px solid #5e4d1f; border-radius: 8px; background: #080a0b; color: #f4ead0; box-shadow: 0 22px 52px rgba(31, 18, 4, 0.28); }
      .lord-tools-shell:has(.lord-research-workspace) > .lord-intro { display: none; }
      .shell:has(.lord-research-workspace) { width: min(1540px, calc(100vw - 28px)); grid-template-columns: 210px minmax(0, 1fr); }
      .lord-research-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid #403a25; background: linear-gradient(180deg, #17191b, #0d0f11); }
      .lord-research-head h3 { margin: 0; color: #f1dca6; font-size: 25px; font-weight: 800; letter-spacing: 0.02em; }
      .lord-research-head p { margin: 4px 0 0; color: #8e8b82; font-size: 13px; }
      .lord-research-reset { min-width: 76px; border-color: #9a7809; background: #121313; color: #efd351; }
      .lord-research-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 650px; }
      .lord-research-settings { display: flex; flex-direction: column; align-items: stretch; gap: 15px; min-width: 0; padding: 18px 16px; border-right: 1px solid #393527; background: linear-gradient(180deg, #141618, #0d0f10); }
      .lord-research-settings-heading { min-width: 0; padding-bottom: 13px; border-bottom: 1px solid #30312d; }
      .lord-research-settings-heading strong { display: block; color: #ead48d; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
      .lord-research-settings-heading small { display: block; margin-top: 4px; color: #777a76; font-size: 10px; line-height: 1.3; }
      .lord-research-settings label { display: grid; gap: 5px; min-width: 0; color: #99978f; font-size: 10px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
      .lord-research-settings input, .lord-research-settings select { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border-color: #5b4b19; border-radius: 5px; background: #0b0d0f; color: #eee5ce; }
      .lord-research-inspector { border-left: 1px solid #333226; }
      .lord-research-panel-title { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; color: #e9d392; font-size: 13px; font-weight: 1000; letter-spacing: 0.08em; text-transform: uppercase; }
      .lord-research-panel-title::before { content: ""; width: 28px; height: 28px; border: 1px solid #705c1f; border-radius: 50%; background: radial-gradient(circle, #493b12, #18170e); }
      .lord-research-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 62px; margin-top: 3px; padding: 10px 12px; border: 1px solid #5b4b19; border-radius: 6px; background: #0b0d0f; color: #d4c9ab; text-align: left; }
      .lord-research-toggle i { position: relative; width: 35px; height: 19px; flex: 0 0 auto; border-radius: 999px; background: #343536; }
      .lord-research-toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #aaa; transition: transform .18s ease, background .18s ease; }
      .lord-research-toggle.on { border-color: #9b7b17; color: #f2d967; }
      .lord-research-toggle.on i { background: #59490f; }
      .lord-research-toggle.on i::after { transform: translateX(16px); background: #f0cc3e; }
      .lord-research-main { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; background: #060809; }
      body.lord-research-fullscreen-open { overflow: hidden; }
      .lord-research-main.is-fullscreen, .lord-research-main:fullscreen { position: fixed; inset: 0; z-index: 10000; width: 100vw; height: 100dvh; min-height: 100vh; background: #060809; }
      .lord-research-main.is-fullscreen .lord-research-tree-scroll, .lord-research-main:fullscreen .lord-research-tree-scroll { height: auto; min-height: 0; }
      .lord-research-tabs { display: flex; align-items: stretch; min-height: 52px; border-bottom: 1px solid #343328; background: #0d0f11; }
      .lord-research-tab { min-width: 142px; border: 0; border-right: 1px solid #252728; border-radius: 0; background: transparent; color: #9b9990; font-weight: 900; }
      .lord-research-tab.active { color: #f0d05b; box-shadow: inset 0 -2px #d0a500; }
      .lord-research-tab:hover { color: #f5df8c; background: rgba(208, 165, 0, .07); }
      .lord-research-hint { display: flex; align-items: center; justify-content: flex-end; margin-left: auto; padding: 0 16px; color: #7f827d; font-size: 11px; font-weight: 800; white-space: nowrap; }
      .lord-research-fullscreen-control { display: flex; align-items: center; padding-right: 10px; }
      .lord-research-fullscreen-toggle { display: grid; place-items: center; width: 36px; min-width: 36px; height: 34px; padding: 0; border: 1px solid #544819; border-radius: 6px; background: #151717; color: #ead16e; }
      .lord-research-fullscreen-toggle:hover { border-color: #b99318; background: #20211b; }
      .lord-research-fullscreen-icon { position: relative; width: 16px; height: 16px; }
      .lord-research-fullscreen-icon::before, .lord-research-fullscreen-icon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#ead16e, #ead16e) left top / 6px 2px no-repeat, linear-gradient(#ead16e, #ead16e) left top / 2px 6px no-repeat, linear-gradient(#ead16e, #ead16e) right top / 6px 2px no-repeat, linear-gradient(#ead16e, #ead16e) right top / 2px 6px no-repeat, linear-gradient(#ead16e, #ead16e) left bottom / 6px 2px no-repeat, linear-gradient(#ead16e, #ead16e) left bottom / 2px 6px no-repeat, linear-gradient(#ead16e, #ead16e) right bottom / 6px 2px no-repeat, linear-gradient(#ead16e, #ead16e) right bottom / 2px 6px no-repeat; }
      .lord-research-main.is-fullscreen .lord-research-fullscreen-icon::before, .lord-research-main:fullscreen .lord-research-fullscreen-icon::before { transform: scale(.68); }
      .lord-research-main.is-fullscreen .lord-research-fullscreen-icon::after, .lord-research-main:fullscreen .lord-research-fullscreen-icon::after { transform: scale(-1); }
      .lord-research-summary { position: absolute; z-index: 8; top: 12px; left: 12px; width: min(390px, calc(100% - 24px)); overflow: hidden; border: 1px solid #263b47; border-radius: 8px; background: rgba(5, 10, 20, .94); box-shadow: 0 10px 28px rgba(0, 0, 0, .4); backdrop-filter: blur(7px); }
      .lord-research-summary-title { padding: 10px 12px; border-bottom: 1px solid #26313c; color: #d5d6d4; font-size: 11px; font-weight: 1000; letter-spacing: .04em; }
      .lord-research-summary-speed, .lord-research-summary-resources { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 12px; }
      .lord-research-summary-speed { border-bottom: 1px solid #1c2933; }
      .lord-research-summary span { color: #777f79; font-size: 9px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
      .lord-research-summary strong { color: #9ee4ca; font-size: 11px; white-space: nowrap; }
      .lord-research-summary-speed strong { margin-left: auto; color: #efd970; }
      .lord-research-summary-resources { flex-wrap: wrap; }
      .lord-research-summary-resources > span { margin-right: 3px; }
      .lord-research-summary .lord-research-resource { display: inline-flex; align-items: center; gap: 4px; }
      .lord-research-resource img { width: 18px; height: 18px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55)); }
      .lord-research-tree-scroll { position: relative; min-height: 650px; height: clamp(650px, calc(100vh - 222px), 870px); overflow: hidden; overscroll-behavior: contain; touch-action: none; cursor: grab; background-color: #02070d; background-image: radial-gradient(circle at 8% 26%, rgba(174, 214, 255, .72) 0 1px, transparent 1.5px), radial-gradient(circle at 28% 72%, rgba(174, 214, 255, .48) 0 1px, transparent 1.5px), radial-gradient(circle at 52% 18%, rgba(174, 214, 255, .56) 0 1px, transparent 1.5px), radial-gradient(circle at 76% 64%, rgba(174, 214, 255, .44) 0 1px, transparent 1.5px), radial-gradient(circle at 91% 33%, rgba(174, 214, 255, .58) 0 1px, transparent 1.5px), radial-gradient(ellipse at 52% 60%, rgba(11, 47, 68, .48), transparent 66%), linear-gradient(180deg, #010407 0%, #020a12 48%, #071a29 100%); background-size: 173px 137px, 229px 181px, 311px 223px, 263px 197px, 347px 251px, auto, auto; }
      .lord-research-tree-scroll.is-dragging { cursor: grabbing; user-select: none; }
      .lord-research-tree { position: absolute; top: 0; left: 0; margin: 0; transform-origin: 0 0; will-change: transform; background: radial-gradient(ellipse at center, rgba(8, 52, 42, .2), transparent 70%); box-shadow: none; }
      .lord-research-lines { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; }
      .lord-research-line { fill: none; stroke: #3a6a7b; stroke-width: 2; opacity: .45; filter: drop-shadow(0 0 1px #1a3a4b); }
      .lord-research-line.done { stroke: #d4a853; opacity: 1; filter: drop-shadow(0 0 2px rgba(212, 168, 83, .4)); }
      .lord-research-node { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; width: 84px; min-height: 76px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #d8d6cb; text-align: center; }
      .lord-research-node:hover, .lord-research-node.selected { transform: translateY(-2px); filter: brightness(1.12); }
      .lord-research-node.selected .lord-research-node-art { filter: drop-shadow(0 0 7px #efc631); }
      .lord-research-node-art { position: relative; width: 48px; height: 48px; padding: 4px; background-position: center; background-repeat: no-repeat; background-size: contain; }
      .lord-research-node.t1 .lord-research-node-art { background-image: url('/assets/research/ui/t1_bg.png'); }
      .lord-research-node.t2 .lord-research-node-art { background-image: url('/assets/research/ui/t2_bg.png'); }
      .lord-research-node.t3 .lord-research-node-art { background-image: url('/assets/research/ui/t3_bg.png'); }
      .lord-research-node.t4 .lord-research-node-art { background-image: url('/assets/research/ui/t4_bg.png'); }
      .lord-research-node.t5 .lord-research-node-art { background-image: url('/assets/research/ui/t5_bg.png'); }
      .lord-research-node-art::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: url('/assets/research/ui/frame.png') center / contain no-repeat; }
      .lord-research-node-art img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; transform: translateZ(0); backface-visibility: hidden; }
      .lord-research-node.available .lord-research-node-art { filter: brightness(.82) saturate(.92); }
      .lord-research-node.locked .lord-research-node-art { filter: brightness(.52) saturate(.55); opacity: .8; }
      .lord-research-node.locked > strong { color: #898b88; }
      .lord-research-node-level { position: absolute; left: 50%; bottom: -3px; z-index: 3; display: grid; place-items: center; width: 32px; min-width: 32px; height: 14px; padding: 0 2px; border: 1px solid #6b6a65; border-radius: 3px; background: rgba(3, 4, 5, .92); color: #ece8dc; font-size: 8px; line-height: 1; font-weight: 1000; transform: translateX(-50%); }
      .lord-research-node > strong { display: -webkit-box; width: 84px; max-height: 24px; margin-top: 3px; overflow: hidden; color: #d8d6cb; font-family: system-ui, sans-serif; font-size: 10px; line-height: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
      .lord-research-inspector-inner { display: grid; gap: 13px; }
      .lord-research-selected { display: grid; justify-items: center; gap: 8px; padding: 15px; border: 1px solid #3f3b28; border-radius: 7px; background: #0c0e10; text-align: center; }
      .lord-research-selected img { width: 82px; height: 82px; padding: 8px; object-fit: contain; background: url('/assets/research/ui/frame.png') center / contain no-repeat; }
      .lord-research-selected h4 { margin: 0; color: #f0dfad; font-size: 17px; }
      .lord-research-selected p { margin: 0; color: #8f8e88; font-size: 11px; }
      .lord-research-level-controls { display: grid; grid-template-columns: 38px 1fr 38px; gap: 6px; width: 100%; }
      .lord-research-level-controls button { min-height: 36px; padding: 5px; border-color: #594a1c; background: #181916; color: #eed160; }
      .lord-research-level-controls strong { display: grid; place-items: center; border: 1px solid #3d3c31; border-radius: 5px; background: #080a0b; }
      .lord-research-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
      .lord-research-actions button { min-height: 34px; padding: 6px; border-color: #594a1c; background: #151615; color: #d8c98f; font-size: 10px; }
      .lord-research-costs { display: grid; gap: 6px; }
      .lord-research-costs div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 9px; border: 1px solid #2c302c; border-radius: 5px; background: #0c0f0e; }
      .lord-research-costs span { color: #8d8f8b; font-size: 10px; text-transform: uppercase; }
      .lord-research-costs strong { color: #e6d9b7; font-size: 12px; }
      .lord-research-empty { padding: 20px 8px; color: #85857f; font-size: 12px; text-align: center; }
      .lord-building-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
      .lord-building-card { display: grid; grid-template-columns: 50px minmax(0, 1fr) 86px; gap: 11px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 249, 224, 0.72); }
      .lord-building-card img { width: 50px; height: 50px; object-fit: contain; }
      .lord-building-card strong { display: block; }
      .lord-building-card small { color: var(--muted); }
      .lord-building-card input { min-width: 0; padding: 8px; text-align: center; }
      .lord-active-decorations { color: #1f683e; font-size: 12px; font-weight: 1000; }
      .lord-empty { grid-column: 1 / -1; }

      @media (max-width: 1120px) {
        .shell { width: min(100%, calc(100vw - 20px)); grid-template-columns: 220px minmax(0, 1fr); }
        .shell:has(.lord-research-workspace) { width: min(100%, calc(100vw - 20px)); grid-template-columns: 190px minmax(0, 1fr); }
        .topbar { grid-template-columns: 1fr; align-items: start; }
        .top-actions { justify-content: flex-start; flex-wrap: wrap; }
        .grid, .stats, .form-grid, .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .two, .players, .dashboard-main, .attendance-grid { grid-template-columns: 1fr; }
        .wiki-inspector { grid-template-columns: 1fr; align-items: stretch; }
        .wiki-style-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .wiki-style-controls--picture { grid-template-columns: 1fr; }
        .calendar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .event-calendar .calendar-day,
        .attendance-calendar-card .event-calendar .calendar-day { min-height: 150px; }
        .command-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .buff-week-heading, .buff-day-row { grid-template-columns: 110px minmax(230px, 1fr) minmax(220px, 0.8fr); gap: 14px; }
        .lord-grid, .lord-speedups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .lord-tool-grid, .lord-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .lord-research-layout { grid-template-columns: 205px minmax(0, 1fr); }
        .lord-building-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      }
      @media (max-width: 780px) {
        body { background-attachment: scroll; }
        .command-settings-grid { grid-template-columns: 1fr; }
        .lord-intro { grid-template-columns: 58px minmax(0, 1fr); }
        .lord-intro > img { width: 58px; height: 58px; }
        .lord-save-state { grid-column: 1 / -1; display: flex; justify-content: space-between; text-align: left; }
        .lord-tool-grid, .lord-catalog, .lord-pairings, .lord-calc-grid, .lord-building-grid { grid-template-columns: 1fr; }
        .lord-research-head { align-items: flex-start; padding: 15px; }
        .lord-research-head h3 { font-size: 21px; }
        .lord-research-layout { grid-template-columns: 1fr; min-height: 0; }
        .lord-research-settings, .lord-research-inspector { border: 0; border-bottom: 1px solid #333226; }
        .lord-research-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
        .lord-research-settings-heading { grid-column: 1 / -1; }
        .lord-research-main { min-height: 590px; }
        .lord-research-tabs { min-height: 54px; }
        .lord-research-tab { min-width: 42%; }
        .lord-research-hint { display: none; }
        .lord-research-tabs { flex-wrap: wrap; }
        .lord-research-fullscreen-control { margin-left: auto; padding: 7px 10px; }
        .lord-research-summary { top: 8px; left: 8px; width: min(370px, calc(100% - 16px)); }
        .lord-research-summary-title { padding: 8px 10px; }
        .lord-research-summary-speed, .lord-research-summary-resources { padding: 7px 10px; }
        .lord-research-resource img { width: 17px; height: 17px; }
        .lord-research-summary span { font-size: 8px; }
        .lord-research-summary strong { font-size: 10px; }
        .lord-research-tree-scroll { min-height: 520px; height: 68dvh; max-height: 720px; }
        .lord-research-inspector-inner { grid-template-columns: 1fr; }
        .lord-catalog-toolbar { grid-template-columns: 1fr; }
        .profile-hub-nav { margin-inline: -4px; }
        .lord-navigation { grid-template-columns: 1fr; }
        .lord-tabs { display: none; }
        .lord-view-select { min-height: 48px; }
        .shell {
          width: 100%;
          min-height: 100vh;
          margin: 0;
          border-radius: 0;
          grid-template-columns: 1fr;
          border-left: 0;
          border-right: 0;
          overflow: visible;
        }
        .shell:has(.lord-research-workspace) { width: 100%; grid-template-columns: 1fr; }
        .shell > aside {
          position: fixed;
          top: 0;
          bottom: 0;
          left: 0;
          z-index: 60;
          width: min(82vw, 310px);
          height: 100dvh;
          max-height: 100dvh;
          min-height: 100dvh;
          overflow-y: auto;
          padding: 18px 14px;
          border-right: 1px solid rgba(255, 214, 90, 0.34);
          transform: translateX(-105%);
          transition: transform 220ms ease;
          box-shadow: 22px 0 54px rgba(0, 0, 0, 0.42);
        }
        .shell > aside.open { transform: translateX(0); }
        .mobile-nav-backdrop {
          position: fixed;
          inset: 0;
          z-index: 55;
          border: 0;
          background: rgba(13, 8, 4, 0.58);
          backdrop-filter: blur(3px);
        }
        .mobile-nav-backdrop.open { display: block; }
        .brand { margin-bottom: 18px; padding: 0 2px; }
        .brand-logo { width: 42px; height: 42px; border-radius: 50%; }
        .brand strong { font-size: 14px; }
        .brand span { font-size: 10px; }
        nav {
          display: grid;
          gap: 7px;
          overflow-y: auto;
          padding: 0 2px 18px;
        }
        nav a {
          width: 100%;
          min-height: 48px;
          max-width: none;
          padding: 9px 11px;
          font-size: 14px;
        }
        nav a.active, nav a:hover { transform: translateX(2px); }
        .nav-icon { width: 26px; height: 26px; }
        .side-spacer, .side-footer { display: none; }
        .content { padding: 18px 12px 92px; }
        .hero { grid-template-columns: 1fr; display: grid; align-items: start; }
        .topbar {
          position: sticky;
          top: 0;
          z-index: 40;
          display: flex;
          align-items: center;
          justify-content: space-between;
          min-height: 64px;
          padding: 8px 10px;
          gap: 8px;
          box-shadow: 0 8px 20px rgba(67, 37, 10, 0.12);
        }
        .guild { gap: 8px; flex: 1 1 auto; }
        .mobile-nav-toggle {
          width: 42px;
          height: 42px;
          flex: 0 0 42px;
          display: grid;
          place-items: center;
          border: 1px solid rgba(109, 69, 25, 0.30);
          border-radius: 10px;
          background: rgba(255, 244, 205, 0.78);
          color: #3b220c;
          font-size: 22px;
          line-height: 1;
        }
        .guild .avatar-img { width: 40px; height: 40px; }
        .guild .muted { display: none; }
        h1 { font-size: 21px; line-height: 1.05; }
        h2 { font-size: 28px; line-height: 1.08; }
        h3 { font-size: 18px; }
        .hero { gap: 13px; margin-bottom: 18px; }
        .hero p { line-height: 1.5; }
        .top-actions { width: auto; flex: 0 0 auto; display: flex; gap: 6px; }
        .top-actions .server-clock, .auth-pill, [data-profile-button] { display: none !important; }
        .top-actions .auth-button, .profile-top-button { width: auto; min-width: 42px; min-height: 42px; justify-content: center; }
        .feedback-top-button { min-width: 42px; padding: 4px; }
        .feedback-top-button img { width: 30px; height: 30px; }
        .feedback-top-button span { display: none; }
        [data-auth-login], [data-auth-logout] { padding: 0 10px; }
        .toolbar { width: 100%; gap: 8px; }
        .toolbar > button,
        .toolbar > a,
        .toolbar > label { flex: 1 1 150px; min-width: 0; }
        .card, .preview, .alliance-stats-card { padding: 16px; }
        .card-header { align-items: flex-start; flex-direction: column; gap: 10px; }
        .buff-week-heading { display: none; }
        .buff-day-row { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
        .buff-current { grid-template-columns: 64px 1fr; }
        .buff-icon { width: 60px; height: 60px; }
        .buff-updated { text-align: left; }
        .training-intro { grid-template-columns: 62px 1fr; padding: 15px; }
        .training-intro img { width: 58px; height: 58px; }
        .training-resource-settings, .training-resource-summary { grid-template-columns: 1fr; }
        .training-resource-summary .training-resource-list { min-width: 0; }
        .training-mix-tier-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .training-mix-row { grid-template-columns: 90px minmax(120px, 1fr) 90px 48px; }
        .training-time-grid, .training-troop-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .training-troop-inputs label:last-child { grid-column: 1 / -1; }
        .training-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .grid, .stats, .form-grid, .quick-grid, .overview-kpis, .time-row, .command-board, .power-trend-row, .power-history-list, .interactive-chart, .attendance-summary-grid, .optional-link-button-fields { grid-template-columns: 1fr; }
        .upload-comparison-row { grid-template-columns: 1fr 1fr; }
        .trend-pill { justify-self: stretch; }
        .calendar-weekdays { gap: 3px; margin-bottom: 5px; font-size: 10px; }
        .calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
        .calendar-day { min-height: 68px; padding: 5px 3px; border-radius: 8px; gap: 3px; text-align: center; }
        .event-calendar .calendar-day,
        .attendance-calendar-card .event-calendar .calendar-day { min-height: 68px; }
        .calendar-day-top { grid-template-columns: 1fr auto 1fr; }
        .calendar-day-number { font-size: 14px; }
        .calendar-day-weekday { font-size: 9px; }
        .calendar-day-buff { width: 20px; height: 20px; }
        .calendar-day-buff img { width: 16px; height: 16px; }
        .calendar-day-list { display: flex; justify-content: center; align-items: center; gap: 3px; overflow: hidden; }
        .calendar-entry { width: 6px; height: 6px; min-width: 6px; border: 0; border-radius: 50%; padding: 0; background: #b3262f; color: transparent; font-size: 0; }
        .calendar-entry small, .calendar-empty { display: none; }
        .calendar-entry.buff { display: block; width: 26px; height: 26px; min-width: 26px; border-radius: 7px; background: rgba(255, 250, 226, 0.72); }
        .calendar-entry.buff img { display: block; width: 24px; height: 24px; }
        .calendar-more { font-size: 9px; line-height: 1; }
        .metric-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
        .metric-button { min-height: 36px; padding: 5px 6px; font-size: 9px; }
        table { min-width: 680px; }
        th, td { padding: 11px 12px; }
        .member-modal { padding: 10px; align-items: end; }
        .member-modal-panel { width: 100%; max-height: calc(100vh - 24px); border-radius: 14px 14px 0 0; padding: 18px; }
        .member-profile-hero { grid-template-columns: 1fr; text-align: center; padding-right: 0; justify-items: center; }
        .profile-stats { grid-template-columns: 1fr; }
        .profile-season-card { margin-inline: -8px; padding: 14px 8px; border-radius: 10px; }
        .profile-season-topbar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 0 2px; }
        .profile-season-head { grid-column: 1; text-align: left; margin-bottom: 0; }
        .profile-season-head h4 { font-size: 19px; }
        .profile-season-head p { font-size: 10px; }
        .profile-graph-toggle { grid-column: 2; grid-template-columns: 28px auto 30px; gap: 5px; min-height: 40px; max-width: 154px; padding: 5px 7px 5px 5px; }
        .profile-graph-toggle img { width: 28px; height: 28px; }
        .profile-graph-toggle-copy strong { font-size: 9px; }
        .profile-graph-toggle-copy small { font-size: 8px; }
        .profile-radar { width: calc(100% + 4px); max-width: 520px; margin-inline: -2px; }
        .radar-label { font-size: 12px; }
        .radar-value { font-size: 9px; }
        .profile-trend-summary { padding: 8px 8px 0; }
        .profile-trend-summary strong { font-size: 22px; }
        .profile-trend-svg { width: calc(100% + 2px); margin-inline: -1px; }
        .profile-radar-snapshots-label { text-align: left; padding-left: 2px; }
        .profile-radar-dates { display: none; }
        .profile-radar-date-select-shell { display: grid; gap: 5px; }
        .profile-radar-date-select-shell span { color: #76532f; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
        .profile-radar-date-select:focus { border-color: #a85f0d; outline: 3px solid rgba(255, 211, 67, 0.52); }
        .modal-close { top: 10px; right: 10px; }
        .wiki-builder-toolbar .muted { flex-basis: 100%; }
        .wiki-search-row { grid-template-columns: 1fr; }
        .wiki-search-count { text-align: left; }
        .wiki-canvas-wrap { width: 100%; max-height: none; padding: 12px; margin: 0 -4px; }
        .wiki-page-canvas { width: 760px; max-width: none; }
        .wiki-reader { width: 100%; min-width: 0; overflow: hidden; }
        .wiki-reader-stage { width: 100%; overflow-x: auto; overflow-y: hidden; }
        .wiki-inspector { top: 236px; padding: 10px; max-height: calc(100vh - 250px); overflow: auto; }
        .wiki-style-controls { grid-template-columns: 1fr; }
        .wiki-inline-format { grid-template-columns: repeat(3, 38px) minmax(100px, 1fr); }
        .wiki-inline-format label:last-child { grid-column: 1 / -1; }
        .wiki-misc-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .avatar-cropper { align-items: end; padding: 10px; }
        .avatar-cropper-panel { width: 100%; border-radius: 14px 14px 0 0; padding: 18px; }
        .toast-stack { right: 12px; bottom: 78px; width: calc(100vw - 24px); }
        .kofi-tip { right: 14px; bottom: 14px; padding: 9px 13px 9px 9px; }
      }
      @media (max-width: 520px) {
        .shell > aside { padding: 16px 12px; }
        .topbar { top: 0; }
        .lord-research-head { gap: 10px; padding: 13px 12px; }
        .lord-research-head h3 { font-size: 19px; }
        .lord-research-head p { font-size: 11px; line-height: 1.35; }
        .lord-research-reset { min-width: 62px; padding: 8px; }
        .lord-research-settings { grid-template-columns: 1fr; }
        .lord-research-settings-heading { grid-column: auto; }
        .lord-research-tabs { min-height: 50px; }
        .lord-research-tab { min-width: 50%; padding-inline: 8px; }
        .lord-research-summary { padding: 0; }
        .lord-research-summary-title, .lord-research-summary-speed, .lord-research-summary-resources { padding: 7px 9px; }
        .lord-research-summary strong { font-size: 10px; }
        .lord-research-tree-scroll { min-height: 470px; max-height: 65vh; }
        .profile-top-button, .auth-button { min-height: 42px; }
        .stats, .quick-grid { gap: 10px; }
        .stat strong { font-size: 23px; }
        .overview-panel { min-height: 220px; padding: 17px; }
        .calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
        .calendar-day,
        .event-calendar .calendar-day,
        .attendance-calendar-card .event-calendar .calendar-day { min-height: 58px; }
        .metric-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .member-cell { min-width: 190px; }
        table { min-width: 620px; }
        .power-sparkline { height: 86px; }
        .interactive-chart .power-sparkline { height: 180px; }
        .wiki-page-canvas { width: 760px; }
        .wiki-reader-toolbar { justify-content: center; }
        .wiki-misc-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .training-mode-tabs { gap: 5px; padding: 5px; }
        .training-mode-button { min-height: 42px; padding: 7px 5px; font-size: 11px; }
        .training-input-grid { grid-template-columns: 1fr; }
        .training-time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .training-calculator-card { padding: 15px; }
        .training-summary strong { font-size: 17px; }
        .training-resource-list { grid-template-columns: repeat(2, minmax(90px, 1fr)); min-width: 205px; }
        .training-table-resources { min-width: 760px; }
        .training-mode-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .training-mix-tier-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .training-mix-row { grid-template-columns: minmax(0, 1fr) 78px 48px; }
        .training-mix-row > strong { grid-column: 1 / -1; }
        .training-plan-actions { align-items: stretch; flex-direction: column; }
        .training-plan-actions button { width: 100%; }
        .lord-grid, .lord-speedups { grid-template-columns: 1fr 1fr; gap: 8px; }
        .lord-summary-card { padding: 12px; }
        .lord-summary-card strong { font-size: 19px; }
        .lord-tool-card { min-height: 96px; grid-template-columns: 44px minmax(0, 1fr); padding: 12px; }
        .lord-tool-card img { width: 44px; height: 44px; }
        .lord-catalog-card, .lord-calc-card, .lord-pair-card { padding: 12px; }
        .lord-calc-results { grid-template-columns: 1fr 1fr; }
        .lord-pet-preview { grid-template-columns: 72px minmax(0, 1fr); }
        .lord-pet-preview img { width: 72px; height: 72px; }
        .kofi-tip { gap: 0; padding: 8px; font-size: 0; }
        .kofi-tip img { width: 32px; height: 32px; }
      }
    