/*
 * kanso.css. Opt-in Linear-shell + Kanso-palette redesign.
 *
 * Activated by <html data-theme="kanso">. The default theme is still
 * "redesign". Users opt into Kanso via the layout toggle, which sets
 * localStorage["fl-theme"]="kanso" and the inline early-load script in
 * layout.html applies the attribute synchronously.
 *
 * Schemes inside Kanso: kanso-zen (default), kanso-ink, kanso-pearl.
 * The existing six schemes (ember/abyss/frost/verdant/parchment/dusk)
 * remain available in the Classic theme.
 *
 * All CSS variable names mirror the ones in redesign.css so component
 * styling (cards, tables, forms, posts, wiki content) continues to
 * work without changes.
 */

/* =========================================================
   PALETTE. Kanso Zen (default) + Ink + Pearl
   ========================================================= */

/* Theme-wide configuration for Kanso. Applies to every Kanso scheme.
   Typography + spacing + radius scale, not palette. */
[data-theme="kanso"] {
    --font-display:   'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    --font-prose:     'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    --font-sans:      'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    /* --font-mono unchanged */

    /* Spacing scale mirrors redesign.css. Kept here so Kanso layout
       calculations work even if a user picks a Classic scheme like
       Ember inside Kanso theme. */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2.5rem;
    --space-2xl: 4rem;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

/* Kanso Zen. Default scheme inside Kanso theme. Set when the user
   opts in via the layout toggle and has no scheme stored yet. */
[data-theme="kanso"][data-scheme="kanso-zen"] {
    --bg-body:        #090E13;
    --bg-panel:       #14171D;
    --bg-secondary:   #0E1318;
    --bg-hover:       #1B2027;
    --bg-active:      #22262D;
    --bg-input:       #14171D;
    --bg-input-sm:    rgba(20, 23, 29, 0.6);
    --bg-nav:         rgba(9, 14, 19, 0.92);
    --bg-header:      #0C1116;
    --bg-sidebar:     #0E1318;
    --bg-code:        #14171D;

    --warm-white-rgb: 197, 201, 199;
    --border:         #22262D;
    --border-hover:   #393B44;
    --border-focus:   rgba(139, 164, 176, 0.40);

    --text:           #A8ACAA;
    --text-bright:    #C5C9C7;
    --text-dim:       #75797F;
    --text-fade:      #5C6066;

    --highlight:      #8BA4B0;
    --highlight-hover:#9DB5C1;
    --highlight-rgb:  139, 164, 176;
    --accent-muted:   rgba(var(--highlight-rgb), 0.10);

    --accent:         #87A987;
    --accent-hover:   #98BA98;
    --accent-rgb:     135, 169, 135;
    --success:        #87A987;
    --success-muted:  rgba(var(--accent-rgb), 0.10);

    --error:          #C4746E;
    --error-rgb:      196, 116, 110;
    --error-bg:       rgba(var(--error-rgb), 0.08);

    --link:           #8BA4B0;
    --link-hover:     #9DB5C1;

    --warn:           #c4b28a;
    --warn-rgb:       196, 178, 138;
}

/* Kanso Ink. Lifted off the deepest black for slightly softer contrast.
   Shares accents and text colors with Zen. */
[data-theme="kanso"][data-scheme="kanso-ink"] {
    --bg-body:      #14171D;
    --bg-panel:     #1B1F26;
    --bg-secondary: #181C23;
    --bg-hover:     #22262D;
    --bg-active:    #2A2E36;
    --bg-input:     #1B1F26;
    --bg-input-sm:  rgba(27, 31, 38, 0.6);
    --bg-nav:       rgba(20, 23, 29, 0.95);
    --bg-header:    #181C23;
    --bg-sidebar:   #181C23;
    --bg-code:      #1B1F26;

    --warm-white-rgb: 197, 201, 199;
    --border:         #22262D;
    --border-hover:   #393B44;
    --border-focus:   rgba(139, 164, 176, 0.40);

    --text:           #A8ACAA;
    --text-bright:    #C5C9C7;
    --text-dim:       #75797F;
    --text-fade:      #5C6066;

    --highlight:      #8BA4B0;
    --highlight-hover:#9DB5C1;
    --highlight-rgb:  139, 164, 176;
    --accent-muted:   rgba(var(--highlight-rgb), 0.10);

    --accent:         #87A987;
    --accent-hover:   #98BA98;
    --accent-rgb:     135, 169, 135;
    --success:        #87A987;
    --success-muted:  rgba(var(--accent-rgb), 0.10);

    --error:          #C4746E;
    --error-rgb:      196, 116, 110;
    --error-bg:       rgba(var(--error-rgb), 0.08);

    --link:           #8BA4B0;
    --link-hover:     #9DB5C1;

    --warn:           #c4b28a;
    --warn-rgb:       196, 178, 138;
}

[data-theme="kanso"][data-scheme="kanso-pearl"] {
    --bg-body:        #F2F1EF;
    --bg-panel:       #FBFAF8;
    --bg-secondary:   #E8E7E3;
    --bg-hover:       #DDDDDB;
    --bg-active:      #D3D3D0;
    --bg-input:       #FBFAF8;
    --bg-input-sm:    rgba(251, 250, 248, 0.75);
    --bg-nav:         rgba(242, 241, 239, 0.95);
    --bg-header:      #ECEAE6;
    --bg-sidebar:     #ECEAE6;
    --bg-code:        #F8F6F2;

    --warm-white-rgb: 34, 38, 45;
    --border:         rgba(var(--warm-white-rgb), 0.12);
    --border-hover:   rgba(var(--warm-white-rgb), 0.22);
    --border-focus:   rgba(102, 147, 191, 0.4);

    --text:           #3D4148;
    --text-bright:    #22262D;
    --text-dim:       #6D6D69;
    --text-fade:      #9A9A95;

    --highlight:      #6693BF;
    --highlight-hover:#7AA3CC;
    --highlight-rgb:  102, 147, 191;
    --accent-muted:   rgba(var(--highlight-rgb), 0.10);

    --accent:         #6E915F;
    --accent-hover:   #5A7D4D;
    --accent-rgb:     110, 145, 95;
    --success:        #6E915F;
    --success-muted:  rgba(var(--accent-rgb), 0.10);

    --error:          #D7474B;
    --error-rgb:      215, 71, 75;
    --error-bg:       rgba(var(--error-rgb), 0.06);

    --link:           #6693BF;
    --link-hover:     #4F7CAA;

    --warn:           #77713f;
    --warn-rgb:       119, 113, 63;
    --success:        #6E915F;
    --success-muted:  rgba(var(--accent-rgb), 0.10);
}

/* =========================================================
   GLOBAL BASE
   ========================================================= */

[data-theme="kanso"] body {
    background: var(--bg-body);
    color: var(--text-bright);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    font-feature-settings: 'kern' 1, 'ss01' 1, 'ss02' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
[data-theme="kanso"] a { color: var(--text-bright); text-decoration: none; transition: color .15s; }
[data-theme="kanso"] a:hover { color: var(--highlight); }
[data-theme="kanso"] h1, [data-theme="kanso"] h2, [data-theme="kanso"] h3, [data-theme="kanso"] h4 {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: -.015em;
    line-height: 1.15;
}

/* =========================================================
   SHELL TOGGLE. Hide the classic chrome under Kanso, show
   the Kanso shell. Default (no data-theme="kanso") leaves
   the existing layout untouched.
   ========================================================= */

.kanso-shell { display: none; }

[data-theme="kanso"] .classic-shell { display: none !important; }
/* display: contents — the wrapper itself takes no space and creates
   no containing block; .k-sidebar / .k-topbar position themselves
   directly to the viewport. Avoids any grid/flex container quirks. */
[data-theme="kanso"] .kanso-shell    { display: contents; }

[data-theme="kanso"] .classic-only { display: none !important; }
[data-theme="kanso"] .kanso-only   { display: block; }

/* Show classic-only / hide kanso-only when NOT on Kanso theme. */
.kanso-only { display: none; }

/* When Kanso is active, the main page content shifts right to
   clear the fixed sidebar and down to clear the topbar. */
[data-theme="kanso"] body > .container,
[data-theme="kanso"] body > main.container {
    margin-left: 240px;
    margin-top: 53px;
    max-width: none;
    padding-left: 28px;
    padding-right: 28px;
}

/* The site-footer rendered by layout.html's footer block sits
   below the main container; keep it inside the Kanso content area. */
[data-theme="kanso"] body > .site-footer { margin-left: 240px; margin-top: 0; }

/* =========================================================
   KANSO SHELL. Sidebar + topbar.
   ========================================================= */

/* (no .kanso-shell sizing — display: contents makes it invisible.) */

/* ----- Sidebar ----- */
.k-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 240px;
    height: 100vh;
    background: var(--bg-body);
    border-right: 1px solid var(--border);
    /* No padding-top — let the brand area span exactly 53px so its
       border-bottom aligns with the .k-topbar's border-bottom (one
       continuous horizontal divider across the viewport). */
    padding: 0 0 14px 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 90;
}
.k-brand {
    display: flex; align-items: center; gap: 10px;
    /* 53px total (box-sizing:border-box global), matches .k-topbar
       so the two bottom borders form a single line across the page. */
    height: 53px;
    padding: 0 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-bright);
    flex-shrink: 0;
    margin: 0 0 14px 0;
}
.k-brand:hover { color: var(--text-bright); }
.k-brand .k-mark {
    width: 22px; height: 22px;
    background: var(--highlight);
    color: var(--bg-body);
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 5px;
    font-family: var(--font-mono); font-weight: 700; font-size: 13px;
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-brand .k-mark { color: var(--bg-body); }
.k-brand-name {
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: -.005em;
}
.k-brand-name .dim {
    color: var(--text-dim);
    font-weight: 400;
    margin-left: 4px;
}

.k-search {
    margin: 6px 12px 18px;
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 13px;
    cursor: text;
}
.k-search svg { width: 13px; height: 13px; flex-shrink: 0; }
.k-search .ph { flex: 1; }
.k-search .kbd {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-fade);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
}

.k-section { padding: 4px 4px 14px; }
.k-label {
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-fade);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 14px 6px;
    display: flex; align-items: center; justify-content: space-between;
}

.k-link {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 14px;
    color: var(--text);
    border-radius: 4px;
    margin: 0 6px;
    font-size: 13px;
    transition: background .1s, color .1s;
}
.k-link svg { width: 14px; height: 14px; color: var(--text-fade); flex-shrink: 0; }
.k-link:hover { background: var(--bg-hover); color: var(--text-bright); }
.k-link.active { background: var(--bg-active); color: var(--text-bright); }
.k-link.active svg { color: var(--highlight); }
.k-link .badge {
    margin-left: auto;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-fade);
}
.k-link .badge.unread {
    color: var(--bg-body);
    background: var(--highlight);
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-link .badge.unread { color: var(--bg-body); }

/* ----- Sidebar scheme switcher + theme toggle ----- */
.k-scheme {
    margin: 0 10px 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
}
.k-scheme-label {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--text-fade);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}
.k-scheme-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.k-scheme-grid button {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    padding: 5px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all .12s;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.k-scheme-grid button:hover { border-color: var(--border-hover); color: var(--text-bright); }
.k-scheme-grid button.active {
    border-color: var(--highlight);
    color: var(--text-bright);
    background: var(--accent-muted);
}
.k-scheme-grid .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--scheme-color, var(--highlight));
    flex-shrink: 0;
}
.k-classic-link {
    display: block;
    margin: 8px 12px 0;
    padding: 6px 10px;
    text-align: center;
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-fade);
    text-transform: uppercase;
    letter-spacing: .06em;
    border: 1px dashed var(--border);
    border-radius: 4px;
    cursor: pointer;
}
.k-classic-link:hover { color: var(--text-bright); border-color: var(--border-hover); }

.k-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-dim);
}
.k-footer .live { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.k-footer .live::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}
.k-footer .play {
    background: var(--highlight);
    color: var(--bg-body);
    padding: 3px 9px;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 11.5px;
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-footer .play { color: var(--bg-body); }
.k-footer .play:hover { background: var(--highlight-hover); color: var(--bg-body); }
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-footer .play:hover { color: var(--bg-body); }

/* ----- Topbar ----- */
.k-topbar {
    position: fixed;
    top: 0; left: 240px; right: 0;
    height: 53px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
    padding: 10px 28px;
    display: flex; align-items: center; gap: 16px;
    z-index: 80;
    backdrop-filter: blur(8px);
}
.k-bc {
    display: flex; align-items: center; gap: 7px;
    font-family: var(--font-mono); font-size: 12px;
    color: var(--text-dim);
}
.k-bc a { color: var(--text-dim); }
.k-bc a:hover { color: var(--text-bright); }
.k-bc .slash { color: var(--text-fade); }
.k-bc .here  { color: var(--text-bright); }
.k-topbar-right {
    margin-left: auto;
    display: flex; align-items: center; gap: 8px;
}
.k-topbar-right .k-icon-btn {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    border-radius: 5px;
}
.k-topbar-right .k-icon-btn:hover { background: var(--bg-panel); color: var(--text-bright); }
.k-topbar-right .k-icon-btn .nav-unread {
    position: absolute;
    top: -1px; right: -3px;
    background: var(--highlight);
    color: var(--bg-body);
    font-family: var(--font-mono); font-size: 9px; font-weight: 700;
    padding: 1px 4px; border-radius: 8px; line-height: 1;
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-topbar-right .k-icon-btn .nav-unread { color: var(--bg-body); }

/* =========================================================
   COMPONENT INHERITANCE
   The site's existing component styles already reference
   --bg-body / --text-bright / --highlight / etc., so they
   render correctly under Kanso once the variables above
   are set. A handful of theme-base bits from redesign.css
   need to be turned off so the Kanso shell isn't fighting
   the old chrome.
   ========================================================= */

[data-theme="kanso"] body::before { display: none !important; }

[data-theme="kanso"] .wiki-content table,
[data-theme="kanso"] .post-body table {
    background: var(--bg-secondary);
}

[data-theme="kanso"] .container {
    padding-top: 32px;
}

/* ---- Sidebar containment + brand overflow fix ---- */
[data-theme="kanso"] .k-sidebar {
    overflow-x: hidden;
    /* Belt-and-suspenders: force top alignment so nothing in the
       cascade can push the sidebar down below y=0. */
    top: 0 !important;
    padding-top: 0 !important;
    transform: none;
}
[data-theme="kanso"] .k-brand {
    overflow: hidden;
    min-width: 0;
    /* Force the brand to sit at the very top of the sidebar. */
    margin-top: 0 !important;
}
[data-theme="kanso"] .k-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}
[data-theme="kanso"] .k-brand-name .dim {
    /* Drop the "forsaken lands" subtitle in the cramped sidebar.
       The brand mark + "Aabahran" alone is enough identity. */
    display: none;
}

/* ---- Topbar opacity + stacking ---- */
[data-theme="kanso"] .k-topbar {
    background: var(--bg-body);
    /* No backdrop-filter: lets content bleed through when the
       page scrolls beneath. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ---- Page-specific sidebars (wiki/forum/admin) keep the existing
   flex layout from style.css. We only adjust:
   (1) sticky top to clear the Kanso topbar (53px tall),
   (2) sidebar backdrop-filter (Kanso has its own background)
   ---- */
[data-theme="kanso"] .wiki-sidebar,
[data-theme="kanso"] .forum-sidebar,
[data-theme="kanso"] .admin-sidebar {
    top: 53px !important;
    max-height: calc(100vh - 53px) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
[data-theme="kanso"] .wiki-sidebar .sidebar-group,
[data-theme="kanso"] .forum-sidebar .sidebar-group,
[data-theme="kanso"] .admin-sidebar .sidebar-group {
    margin-bottom: 14px;
    padding: 0 6px;
}
[data-theme="kanso"] .wiki-sidebar .sidebar-group:last-child,
[data-theme="kanso"] .forum-sidebar .sidebar-group:last-child,
[data-theme="kanso"] .admin-sidebar .sidebar-group:last-child {
    margin-bottom: 0;
}
[data-theme="kanso"] .wiki-sidebar .sidebar-title,
[data-theme="kanso"] .forum-sidebar .sidebar-title,
[data-theme="kanso"] .admin-sidebar .sidebar-title {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-fade);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}
[data-theme="kanso"] .wiki-sidebar .sidebar-title:hover,
[data-theme="kanso"] .forum-sidebar .sidebar-title:hover,
[data-theme="kanso"] .admin-sidebar .sidebar-title:hover {
    color: var(--text-dim);
}
[data-theme="kanso"] .wiki-sidebar .sidebar-title::after,
[data-theme="kanso"] .forum-sidebar .sidebar-title::after,
[data-theme="kanso"] .admin-sidebar .sidebar-title::after {
    content: '▾';
    font-size: 10px;
    color: var(--text-fade);
}
[data-theme="kanso"] .wiki-sidebar .sidebar-group.collapsed .sidebar-title::after,
[data-theme="kanso"] .forum-sidebar .sidebar-group.collapsed .sidebar-title::after,
[data-theme="kanso"] .admin-sidebar .sidebar-group.collapsed .sidebar-title::after {
    content: '▸';
}
[data-theme="kanso"] .wiki-sidebar .sidebar-group.collapsed ul,
[data-theme="kanso"] .forum-sidebar .sidebar-group.collapsed ul,
[data-theme="kanso"] .admin-sidebar .sidebar-group.collapsed ul {
    display: none;
}
[data-theme="kanso"] .wiki-sidebar ul,
[data-theme="kanso"] .forum-sidebar ul,
[data-theme="kanso"] .admin-sidebar ul {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
}
[data-theme="kanso"] .wiki-sidebar li,
[data-theme="kanso"] .forum-sidebar li,
[data-theme="kanso"] .admin-sidebar li {
    margin: 0;
}
[data-theme="kanso"] .wiki-sidebar li a,
[data-theme="kanso"] .forum-sidebar li a,
[data-theme="kanso"] .admin-sidebar li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    color: var(--text);
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    line-height: 1.4;
    transition: background .1s, color .1s;
}
[data-theme="kanso"] .wiki-sidebar li a:hover,
[data-theme="kanso"] .forum-sidebar li a:hover,
[data-theme="kanso"] .admin-sidebar li a:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}
[data-theme="kanso"] .wiki-sidebar li a.active,
[data-theme="kanso"] .forum-sidebar li a.active,
[data-theme="kanso"] .admin-sidebar li a.active {
    background: var(--bg-active);
    color: var(--text-bright);
}
[data-theme="kanso"] .wiki-sidebar .sidebar-icon,
[data-theme="kanso"] .forum-sidebar .sidebar-icon,
[data-theme="kanso"] .admin-sidebar .sidebar-icon {
    width: 13px;
    height: 13px;
    color: var(--text-fade);
    flex-shrink: 0;
}
[data-theme="kanso"] .wiki-sidebar li a:hover .sidebar-icon,
[data-theme="kanso"] .wiki-sidebar li a.active .sidebar-icon,
[data-theme="kanso"] .forum-sidebar li a:hover .sidebar-icon,
[data-theme="kanso"] .forum-sidebar li a.active .sidebar-icon,
[data-theme="kanso"] .admin-sidebar li a:hover .sidebar-icon,
[data-theme="kanso"] .admin-sidebar li a.active .sidebar-icon {
    color: var(--highlight);
}
[data-theme="kanso"] .wiki-sidebar .sidebar-sub,
[data-theme="kanso"] .forum-sidebar .sidebar-sub,
[data-theme="kanso"] .admin-sidebar .sidebar-sub {
    padding-left: 24px !important;
    font-size: 12.5px !important;
    color: var(--text-dim) !important;
}
[data-theme="kanso"] .wiki-main,
[data-theme="kanso"] .forum-main,
[data-theme="kanso"] .admin-main {
    min-width: 0;
}

/* Now-redundant: the global Kanso left sidebar's "Cabals/Wiki/Forum"
   links provide the same global nav. When inside wiki/forum/admin,
   the secondary page-specific sidebar shown above carries the context.
   Both visible. */

/* ---- In-content breadcrumb. Re-style rather than hide so each
   page keeps its real context. The Kanso topbar's own .k-bc
   defaults to empty so the two don't compete. ---- */
[data-theme="kanso"] .breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
[data-theme="kanso"] .breadcrumb a {
    color: var(--text-dim);
    text-decoration: none;
}
[data-theme="kanso"] .breadcrumb a:hover { color: var(--text-bright); }
[data-theme="kanso"] .breadcrumb svg,
[data-theme="kanso"] .breadcrumb i[data-lucide] {
    width: 10px;
    height: 10px;
    color: var(--text-fade);
}

/* ---- Hide the topbar's default breadcrumb when no page has
   overridden the {{block "kanso-breadcrumb"}}. Lets the page's
   own .breadcrumb carry the context. ---- */
[data-theme="kanso"] .k-bc:empty { display: none; }
[data-theme="kanso"] .k-topbar:has(.k-bc:empty) .k-bc { display: none; }

/* =========================================================
   GLOBAL ICON SIZING.
   The site uses <i data-lucide="..."> which the lucide.min.js
   library swaps for inline <svg> at width/height 24 by default.
   Cap them under Kanso so they don't tower over surrounding text.
   ========================================================= */
[data-theme="kanso"] i[data-lucide],
[data-theme="kanso"] .lucide {
    width: 14px;
    height: 14px;
    display: inline-flex;
    vertical-align: -2px;
}
/* Buttons inside content (Search / Mark All Read / New Topic etc) */
[data-theme="kanso"] .btn i[data-lucide],
[data-theme="kanso"] .btn svg,
[data-theme="kanso"] button i[data-lucide],
[data-theme="kanso"] button svg.lucide {
    width: 13px;
    height: 13px;
    margin-right: 4px;
    vertical-align: -2px;
}
/* Icons inside any badge / pill / chip */
[data-theme="kanso"] .badge i[data-lucide],
[data-theme="kanso"] .badge svg,
[data-theme="kanso"] .forum-type-tag i[data-lucide],
[data-theme="kanso"] .forum-type-tag svg,
[data-theme="kanso"] .badge-staff i[data-lucide],
[data-theme="kanso"] .badge-staff svg,
[data-theme="kanso"] .staff-badge i[data-lucide],
[data-theme="kanso"] .staff-badge svg,
[data-theme="kanso"] .user-badge i[data-lucide],
[data-theme="kanso"] .user-badge svg {
    width: 11px;
    height: 11px;
    margin-right: 3px;
    vertical-align: -1px;
}
/* Icons used as anchors (header bell, settings cog, etc.) */
[data-theme="kanso"] .header-user-bell svg,
[data-theme="kanso"] .nav-tabs a svg,
[data-theme="kanso"] .nav-dropdown a svg,
[data-theme="kanso"] .pd-item svg {
    width: 13px;
    height: 13px;
}
/* Icons inside table headers (sort arrows etc.) */
[data-theme="kanso"] th svg,
[data-theme="kanso"] th i[data-lucide] {
    width: 11px;
    height: 11px;
}
/* Icons inside the forum topic-list views: "Search", "Mark All
   Read", "New Topic" buttons usually sit at the right of the
   .forum-header. */
[data-theme="kanso"] .forum-header .btn i[data-lucide],
[data-theme="kanso"] .forum-header .btn svg,
[data-theme="kanso"] .topic-header .btn i[data-lucide],
[data-theme="kanso"] .topic-header .btn svg {
    width: 13px;
    height: 13px;
}
/* The data-icon attribute pattern used on .forum-icon / .subforum-link */
[data-theme="kanso"] [data-icon] i[data-lucide],
[data-theme="kanso"] [data-icon] svg {
    width: 14px;
    height: 14px;
}
/* Anywhere a stray icon got past the rules above, keep it small. */
[data-theme="kanso"] .container i[data-lucide],
[data-theme="kanso"] main i[data-lucide] {
    max-width: 16px;
    max-height: 16px;
}

/* ---- Page-header trim. Existing pages render h1 + action button
   rows; these read fine under Kanso but the action buttons need
   a calmer look. ---- */
[data-theme="kanso"] .wiki-page-header,
[data-theme="kanso"] .topic-header,
[data-theme="kanso"] .forum-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
[data-theme="kanso"] .wiki-page-header h1,
[data-theme="kanso"] .topic-header h1,
[data-theme="kanso"] .forum-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.018em;
    color: var(--text-bright);
    line-height: 1.1;
}
[data-theme="kanso"] .wiki-page-actions,
[data-theme="kanso"] .topic-header-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
    align-items: center;
}
[data-theme="kanso"] .wiki-page-actions .btn,
[data-theme="kanso"] .wiki-page-actions a,
[data-theme="kanso"] .topic-header-actions .btn,
[data-theme="kanso"] .topic-header-actions a,
[data-theme="kanso"] .topic-header-actions button {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
}
[data-theme="kanso"] .wiki-page-actions .btn:hover,
[data-theme="kanso"] .wiki-page-actions a:hover,
[data-theme="kanso"] .topic-header-actions .btn:hover {
    background: var(--bg-panel);
    color: var(--text-bright);
    border-color: var(--border-hover);
}
[data-theme="kanso"] .wiki-page-actions .btn-danger,
[data-theme="kanso"] .topic-header-actions .btn-danger {
    color: var(--error);
    border-color: var(--border);
}
[data-theme="kanso"] .wiki-page-actions .btn-danger:hover,
[data-theme="kanso"] .topic-header-actions .btn-danger:hover {
    border-color: var(--error);
    background: var(--error-bg);
}
/* Shrink lucide icons that pages may embed inside action buttons. */
[data-theme="kanso"] .wiki-page-actions svg,
[data-theme="kanso"] .topic-header-actions svg,
[data-theme="kanso"] .wiki-page-header svg {
    width: 13px;
    height: 13px;
}
/* Shrink lucide icons used inside the existing sidebars (in case
   one becomes visible on a page we haven't hidden it for). */
[data-theme="kanso"] .sidebar-icon {
    width: 14px;
    height: 14px;
}

/* =========================================================
   Multi-select chip widget (.ms ...).
   Used on the Items search form for Affect / Weapon Flag /
   Damage Noun / Extra Flag. JS toggles .ms--open on the
   wrapper; CSS hides the popover otherwise.
   ========================================================= */
[data-theme="kanso"] .ms {
    position: relative;
}
[data-theme="kanso"] .ms-field {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-bright);
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 5px 10px 5px 10px;
    min-height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
[data-theme="kanso"] .ms-field:hover { border-color: var(--border-hover); }
[data-theme="kanso"] .ms.ms--open .ms-field { border-color: var(--highlight); }
[data-theme="kanso"] .ms-chips {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    min-width: 0;
}
[data-theme="kanso"] .ms-placeholder {
    color: var(--text-fade);
    font-size: 13px;
}
[data-theme="kanso"] .ms-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-muted);
    border: 1px solid var(--highlight);
    color: var(--highlight);
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 1px 4px 1px 6px;
    border-radius: 3px;
    line-height: 1.4;
}
[data-theme="kanso"] .ms-chip-x {
    background: none;
    border: none;
    color: var(--highlight);
    cursor: pointer;
    padding: 0 2px;
    font-size: 14px;
    line-height: 1;
}
[data-theme="kanso"] .ms-chip-x:hover { color: var(--text-bright); }
[data-theme="kanso"] .ms-arrow {
    color: var(--text-fade);
    font-size: 10px;
    flex-shrink: 0;
}
[data-theme="kanso"] .ms-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    padding: 6px;
    display: none;
    max-height: 280px;
    overflow-y: auto;
}
[data-theme="kanso"] .ms.ms--open .ms-popover { display: block; }
[data-theme="kanso"] .ms-popover[hidden] { display: none; }
[data-theme="kanso"] .ms.ms--open .ms-popover[hidden] { display: block; }
[data-theme="kanso"] .ms-filter {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-bright);
    font-family: var(--font-sans);
    font-size: 12.5px;
    padding: 5px 8px;
    margin-bottom: 6px;
    outline: none;
}
[data-theme="kanso"] .ms-filter:focus { border-color: var(--highlight); }
[data-theme="kanso"] .ms-options {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}
[data-theme="kanso"] .ms-options li {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
    text-align: left;
}
[data-theme="kanso"] .ms-options li label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 5px 8px;
    width: 100%;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    cursor: pointer;
    border-radius: 3px;
    /* Beat any inherited alignment / casing from parent .form-group label. */
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
}
[data-theme="kanso"] .ms-options li label:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}
[data-theme="kanso"] .ms-options input[type=checkbox] {
    accent-color: var(--highlight);
    margin: 0;
    flex-shrink: 0;
    width: 13px;
    height: 13px;
}

/* =========================================================
   Existing form / table / button styles. The forms on the
   live site use .item-search-form, .form-row, .form-group,
   .btn variants. They look fine in classic but render with
   redesign-specific accents; force them to use Kanso vars.
   ========================================================= */
[data-theme="kanso"] .item-search-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
[data-theme="kanso"] .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
[data-theme="kanso"] .form-row.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
[data-theme="kanso"] .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
[data-theme="kanso"] .form-group label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-fade);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 500;
}
[data-theme="kanso"] .form-group input[type=text],
[data-theme="kanso"] .form-group input[type=number],
[data-theme="kanso"] .form-group input[type=search],
[data-theme="kanso"] .form-group select {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-bright);
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 6px 9px;
    outline: none;
    transition: border-color .12s;
    width: 100%;
    min-width: 0;
}
[data-theme="kanso"] .form-group input::placeholder { color: var(--text-fade); }
[data-theme="kanso"] .form-group input:focus,
[data-theme="kanso"] .form-group select:focus {
    border-color: var(--highlight);
}
[data-theme="kanso"] .form-group select {
    appearance: none;
    padding-right: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2375797F' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
}

[data-theme="kanso"] .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    transition: all .15s;
    background: transparent;
    text-decoration: none;
    line-height: 1.4;
}
[data-theme="kanso"] .btn:hover {
    background: var(--bg-panel);
    color: var(--text-bright);
    border-color: var(--border-hover);
}
[data-theme="kanso"] .btn-primary {
    background: var(--highlight);
    color: var(--bg-body);
    border-color: var(--highlight);
    font-weight: 600;
}
[data-theme="kanso"] .btn-primary:hover {
    background: var(--highlight-hover);
    color: var(--bg-body);
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .btn-primary { color: var(--bg-body); }
[data-theme="kanso"][data-scheme="kanso-pearl"] .btn-primary:hover { color: var(--bg-body); }
[data-theme="kanso"] .btn-small {
    padding: 4px 9px;
    font-size: 12px;
}
[data-theme="kanso"] .btn-danger {
    color: var(--error);
}
[data-theme="kanso"] .btn-danger:hover {
    background: var(--error-bg);
    border-color: var(--error);
    color: var(--error);
}

[data-theme="kanso"] .checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
}
[data-theme="kanso"] .checkbox-inline input { accent-color: var(--highlight); }

/* Item / forum table styling */
[data-theme="kanso"] .item-count {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 0;
    margin: 0;
}
[data-theme="kanso"] .item-count strong { color: var(--text-bright); }

[data-theme="kanso"] .item-table,
[data-theme="kanso"] table.forum-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
}
[data-theme="kanso"] .item-table thead th,
[data-theme="kanso"] table.forum-list thead th {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-dim);
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    background: var(--bg-body);
    white-space: nowrap;
}
[data-theme="kanso"] .item-table thead th.num,
[data-theme="kanso"] table.forum-list thead th.num { text-align: right; }
[data-theme="kanso"] .item-table tbody td,
[data-theme="kanso"] table.forum-list tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
[data-theme="kanso"] .item-table tbody tr:last-child td,
[data-theme="kanso"] table.forum-list tbody tr:last-child td {
    border-bottom: none;
}
[data-theme="kanso"] .item-table tbody tr:hover td,
[data-theme="kanso"] table.forum-list tbody tr:hover td {
    background: var(--bg-panel);
}
[data-theme="kanso"] .item-table td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-bright); }
[data-theme="kanso"] .item-table tbody td a { color: var(--text-bright); font-weight: 500; }
[data-theme="kanso"] .item-table tbody td a:hover { color: var(--highlight); }

/* Generic badges used across templates */
[data-theme="kanso"] .badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 1px 7px;
    border-radius: 3px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 500;
}
[data-theme="kanso"] .badge-category { color: var(--text); }
[data-theme="kanso"] .badge-hidden { color: var(--warn); border-color: var(--warn); }
[data-theme="kanso"] .badge-pin { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.4); }
[data-theme="kanso"] .badge-lock { color: var(--warn); border-color: rgba(var(--warn-rgb), 0.4); }
[data-theme="kanso"] .badge-locked { color: var(--warn); border-color: rgba(var(--warn-rgb), 0.4); }
[data-theme="kanso"] .badge-op { color: var(--highlight); border-color: var(--highlight); background: var(--accent-muted); }
[data-theme="kanso"] .badge-prayer { color: var(--highlight); border-color: var(--highlight); }

/* Pagination */
[data-theme="kanso"] .pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}
[data-theme="kanso"] .pagination a,
[data-theme="kanso"] .pagination .current,
[data-theme="kanso"] .pagination .ellipsis {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 5px 10px;
    min-width: 32px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
}
[data-theme="kanso"] .pagination a:hover {
    color: var(--highlight);
    border-color: var(--highlight);
}
[data-theme="kanso"] .pagination .current {
    background: var(--highlight);
    color: var(--bg-body);
    border-color: var(--highlight);
    font-weight: 600;
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .pagination .current { color: var(--bg-body); }
[data-theme="kanso"] .pagination .ellipsis {
    border-color: transparent;
    color: var(--text-fade);
    cursor: default;
}
[data-theme="kanso"] .pagination .pagination-info {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .04em;
    border: none;
    padding: 5px 10px;
}

/* Forum index rows (when rendered by the live forum.html template). */
[data-theme="kanso"] .category-section { margin-bottom: 28px; }
[data-theme="kanso"] .category-header {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-fade);
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
[data-theme="kanso"] .forum-rows {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    overflow: hidden;
}
[data-theme="kanso"] .forum-row {
    display: grid;
    grid-template-columns: 40px 1fr 130px 280px;
    gap: 18px;
    padding: 14px 18px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    color: var(--text-bright);
    transition: background .12s;
    background: transparent;
}
[data-theme="kanso"] .forum-row:last-child { border-bottom: none; }
[data-theme="kanso"] .forum-row:hover { background: var(--bg-panel); }
[data-theme="kanso"] .forum-icon {
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--highlight);
}
[data-theme="kanso"] .forum-icon svg,
[data-theme="kanso"] .forum-icon i[data-lucide] {
    width: 18px;
    height: 18px;
}
[data-theme="kanso"] .forum-info { min-width: 0; }
[data-theme="kanso"] .forum-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
    line-height: 1.2;
    margin-bottom: 2px;
    letter-spacing: -.005em;
}
[data-theme="kanso"] .forum-name a { color: var(--text-bright); }
[data-theme="kanso"] .forum-name a:hover { color: var(--highlight); }
[data-theme="kanso"] .forum-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.45;
}
[data-theme="kanso"] .subforum-links {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}
[data-theme="kanso"] .subforum-link {
    color: var(--text-dim);
    text-decoration: none;
}
[data-theme="kanso"] .subforum-link:hover { color: var(--highlight); }
[data-theme="kanso"] .forum-stats {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-fade);
    text-align: right;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: .02em;
}
[data-theme="kanso"] .stat-inline { color: var(--text); }
[data-theme="kanso"] .stat-sep { color: var(--text-fade); margin: 0 4px; }
[data-theme="kanso"] .forum-lastpost {
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.4;
}
[data-theme="kanso"] .forum-lastpost a { color: var(--text-bright); font-weight: 500; }
[data-theme="kanso"] .forum-lastpost a:hover { color: var(--highlight); }
[data-theme="kanso"] .lastpost-by {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-fade);
    margin-top: 2px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
[data-theme="kanso"] .no-posts {
    color: var(--text-fade);
    font-style: italic;
}
[data-theme="kanso"] .forum-search-form {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    max-width: 360px;
    margin-left: auto;
}
[data-theme="kanso"] .forum-search-input {
    background: none;
    border: none;
    color: var(--text-bright);
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 7px 12px;
    flex: 1;
    outline: none;
    min-width: 0;
}
[data-theme="kanso"] .forum-search-form .btn {
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
}

/* Forum type tags (private / in-character) */
[data-theme="kanso"] .forum-type-tag {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
[data-theme="kanso"] .forum-tag--private {
    color: var(--warn);
    background: rgba(var(--warn-rgb), 0.10);
    border: 1px solid rgba(var(--warn-rgb), 0.30);
}
[data-theme="kanso"] .forum-tag--anon {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.10);
    border: 1px solid rgba(var(--accent-rgb), 0.30);
}
[data-theme="kanso"] .forum-type-tag svg { width: 11px; height: 11px; }

[data-theme="kanso"] .unread-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    background: var(--highlight);
    color: var(--bg-body);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 700;
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .unread-badge { color: var(--bg-body); }

/* Wiki content prose */
[data-theme="kanso"] .wiki-content {
    color: var(--text);
    font-size: 16px;
    line-height: 1.65;
}
[data-theme="kanso"] .wiki-content h1,
[data-theme="kanso"] .wiki-content h2,
[data-theme="kanso"] .wiki-content h3 {
    color: var(--text-bright);
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -.015em;
    margin: 32px 0 14px;
}
[data-theme="kanso"] .wiki-content h1 { font-size: 26px; }
[data-theme="kanso"] .wiki-content h2 { font-size: 21px; }
[data-theme="kanso"] .wiki-content h3 { font-size: 17px; }
[data-theme="kanso"] .wiki-content p { margin: 0 0 16px; }
[data-theme="kanso"] .wiki-content a { color: var(--highlight); border-bottom: 1px solid var(--accent-muted); }
[data-theme="kanso"] .wiki-content a:hover { color: var(--text-bright); border-color: var(--highlight); }
[data-theme="kanso"] .wiki-page-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-fade);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 36px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* Alerts (used on locked/pending wiki pages, deleted notice) */
[data-theme="kanso"] .alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 13.5px;
    border: 1px solid var(--border);
}
[data-theme="kanso"] .alert-error {
    background: var(--error-bg);
    border-color: rgba(var(--error-rgb), 0.4);
    color: var(--text-bright);
}
[data-theme="kanso"] .alert-pending {
    background: var(--accent-muted);
    border-color: rgba(var(--highlight-rgb), 0.4);
    color: var(--text-bright);
}

/* Topic + post (forum topic view) */
[data-theme="kanso"] .posts { margin: 18px 0; }
[data-theme="kanso"] .post {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
}
[data-theme="kanso"] .post-sidebar {
    color: var(--text-dim);
    font-size: 12.5px;
}
[data-theme="kanso"] .post-author { font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
[data-theme="kanso"] .post-author a { color: var(--text-bright); }
[data-theme="kanso"] .post-author-imm { color: var(--highlight); }
[data-theme="kanso"] .post-date {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-fade);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 8px;
}
[data-theme="kanso"] .post-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}
[data-theme="kanso"] .post-body { color: var(--text); font-size: 14.5px; line-height: 1.6; }
[data-theme="kanso"] .post-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}
[data-theme="kanso"] .post-edited {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-fade);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Footer */
[data-theme="kanso"] .site-footer {
    padding: 24px 28px;
    border-top: 1px solid var(--border);
    color: var(--text-fade);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: center;
}

/* =========================================================
   LANDING PAGE. The new painterly castle hero + supporting
   sections live in .kanso-only inside landing.html.
   ========================================================= */

.kanso-only.kanso-landing {
    margin: -32px -28px 0;
}

/* Cinematic hero band */
.k-hero {
    position: relative;
    height: 70vh;
    min-height: 540px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: var(--bg-body);
}
.k-hero svg.scene {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
}
.k-hero-overlay {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, transparent 0%, transparent 35%, var(--bg-body) 100%),
        radial-gradient(ellipse at 50% 100%, rgba(var(--highlight-rgb), 0.04) 0%, transparent 60%);
    pointer-events: none;
}
.k-hero-content {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 0 56px 64px;
    z-index: 2;
}
.k-hero-kicker {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 11.5px;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--highlight);
    margin-bottom: 22px;
    padding: 6px 12px;
    background: rgba(9, 14, 19, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 4px;
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-hero-kicker { background: rgba(242, 241, 239, 0.7); }
.k-hero-kicker .dot { color: var(--text-fade); }
.k-hero-title {
    font-family: var(--font-sans);
    font-size: 88px;
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: .92;
    color: var(--text-bright);
    margin-bottom: 20px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .55);
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-hero-title { text-shadow: 0 1px 2px rgba(34, 38, 45, .08); }
.k-hero-title .sub {
    display: block;
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -.012em;
    color: var(--text);
    margin-top: 4px;
    line-height: 1.1;
}
.k-hero-tagline {
    font-family: var(--font-sans);
    font-size: 18px;
    font-style: italic;
    color: var(--text);
    line-height: 1.45;
    max-width: 48ch;
    margin-bottom: 32px;
    opacity: 0;
    transition: opacity 1.4s ease-out;
}
.k-hero-tagline.visible { opacity: 0.92; }
.k-hero-tagline::before { content: '"'; color: var(--highlight); font-style: normal; margin-right: 6px; font-weight: 600; }
.k-hero-tagline::after  { content: '"'; color: var(--highlight); font-style: normal; margin-left: 4px;  font-weight: 600; }
.k-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.k-hero-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    font-family: var(--font-sans); font-weight: 600; font-size: 14.5px;
    letter-spacing: -.005em;
    transition: all .15s;
}
.k-hero-btn.primary { background: var(--highlight); color: var(--bg-body); border-color: var(--highlight); }
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-hero-btn.primary { color: var(--bg-body); }
.k-hero-btn.primary:hover { background: var(--highlight-hover); color: var(--bg-body); border-color: var(--highlight-hover); }
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-hero-btn.primary:hover { color: var(--bg-body); }
.k-hero-btn.ghost {
    background: rgba(9, 14, 19, 0.55);
    color: var(--text-bright);
    backdrop-filter: blur(8px);
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-hero-btn.ghost { background: rgba(242, 241, 239, 0.65); }
.k-hero-btn.ghost:hover { border-color: var(--highlight); color: var(--highlight); }
.k-hero-btn .kbd {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-fade);
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 4px;
    letter-spacing: 0;
}
.k-hero-btn.primary .kbd {
    background: rgba(9, 14, 19, 0.25);
    border-color: rgba(9, 14, 19, 0.35);
    color: rgba(9, 14, 19, 0.55);
}

/* Live world strip */
.k-world {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.k-world-inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}
.k-world-cell {
    padding: 18px 18px 18px 0;
    margin-right: 18px;
    border-right: 1px solid var(--border);
}
.k-world-cell:last-child { border-right: none; margin-right: 0; }
.k-world-label {
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-fade);
    text-transform: uppercase; letter-spacing: .08em;
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 6px;
}
.k-world-label .pip {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}
.k-world-value {
    font-family: var(--font-mono); font-size: 24px;
    color: var(--text-bright); font-weight: 600;
    letter-spacing: -.012em;
    font-variant-numeric: tabular-nums;
}
.k-world-value small { color: var(--text-dim); font-size: 13px; font-weight: 400; }
.k-world-sub {
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-dim);
    margin-top: 4px;
    letter-spacing: .04em;
}
.k-world-value.accent { color: var(--highlight); }
.k-world-value.warn   { color: var(--warn); }

/* Section heads */
.k-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 32px 0;
    width: 100%;
}
.k-section-head {
    display: flex; align-items: baseline; gap: 14px;
    margin-bottom: 18px;
}
.k-section-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.018em; }
.k-section-head .num {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-fade);
    text-transform: uppercase; letter-spacing: .04em;
}
.k-section-head .more {
    margin-left: auto;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--highlight);
    text-transform: uppercase; letter-spacing: .04em;
}
.k-section-head .more:hover { color: var(--text-bright); }

/* This-week featured card */
.k-feature {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    margin-bottom: 64px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    align-items: stretch;
}
.k-feature-art {
    position: relative;
    background: var(--bg-panel);
    min-height: 280px;
    overflow: hidden;
}
.k-feature-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.k-feature-art .label {
    position: absolute; top: 16px; left: 18px;
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--highlight);
    text-transform: uppercase; letter-spacing: .14em;
    background: rgba(9, 14, 19, 0.6);
    backdrop-filter: blur(6px);
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 3px;
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-feature-art .label { background: rgba(242, 241, 239, 0.7); }
.k-feature-body { padding: 32px; display: flex; flex-direction: column; }
.k-feature-eyebrow {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--highlight);
    text-transform: uppercase; letter-spacing: .14em;
    margin-bottom: 12px;
}
.k-feature-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.022em;
    margin-bottom: 12px;
    color: var(--text-bright);
}
.k-feature-deck {
    color: var(--text); font-size: 15px; line-height: 1.6;
    margin-bottom: 18px;
}
.k-feature-meta {
    margin-top: auto;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase; letter-spacing: .04em;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.k-feature-meta strong { color: var(--text-bright); }
.k-feature-meta .read { margin-left: auto; color: var(--highlight); }
.k-feature-meta .read:hover { color: var(--text-bright); }

/* Cabals grid */
.k-cabals {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 64px;
}
.k-cabal {
    display: flex; flex-direction: column;
    gap: 10px;
    padding: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-bright);
    transition: all .15s;
}
.k-cabal:hover {
    border-color: var(--highlight);
    background: var(--bg-panel);
    transform: translateY(-1px);
    color: var(--text-bright);
}
.k-cabal-sigil {
    width: 44px; height: 44px;
    color: var(--highlight);
    transition: color .15s;
}
.k-cabal-sigil svg { width: 100%; height: 100%; }
.k-cabal:hover .k-cabal-sigil { color: var(--highlight-hover); }
.k-cabal-name {
    font-size: 18px; font-weight: 700;
    letter-spacing: -.012em; line-height: 1.1;
}
.k-cabal-role {
    color: var(--text-dim);
    font-size: 12.5px; line-height: 1.45;
    flex: 1;
}
.k-cabal-state {
    margin-top: 6px; padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-fade);
    text-transform: uppercase; letter-spacing: .04em;
}
.k-cabal-state strong { color: var(--text); font-weight: 500; }
.k-cabal-state .held { color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.k-cabal-state .held::before {
    content: ''; width: 5px; height: 5px; border-radius: 50%;
    background: var(--accent);
}
.k-cabal-state .vacant { color: var(--warn); }

/* Activity + Connect */
.k-lower {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    margin-bottom: 64px;
}
.k-activity {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.k-activity-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase; letter-spacing: .08em;
}
.k-activity-head strong { color: var(--text-bright); font-weight: 600; }
.k-feed { padding: 4px 0; }
.k-feed-row {
    display: grid;
    grid-template-columns: 56px 1fr 90px;
    gap: 14px;
    padding: 11px 18px;
    align-items: baseline;
    border-bottom: 1px solid var(--border);
    color: var(--text-bright);
    transition: background .12s;
}
.k-feed-row:last-child { border-bottom: none; }
.k-feed-row:hover { background: var(--bg-panel); color: var(--text-bright); }
.k-feed-type {
    font-family: var(--font-mono); font-size: 10px;
    text-transform: uppercase; letter-spacing: .1em;
    text-align: center;
    padding: 2px 0;
    border-radius: 3px;
}
.k-feed-type.post   { color: var(--accent);    border: 1px solid rgba(var(--accent-rgb), 0.30); }
.k-feed-type.wiki   { color: var(--highlight); border: 1px solid rgba(var(--highlight-rgb), 0.30); }
.k-feed-type.bug    { color: var(--error);     border: 1px solid rgba(var(--error-rgb), 0.30); }
.k-feed-type.change { color: var(--warn);      border: 1px solid rgba(var(--warn-rgb), 0.30); }
.k-feed-title { font-size: 13.5px; color: var(--text-bright); line-height: 1.35; font-weight: 500; }
.k-feed-title small {
    display: block; margin-top: 2px;
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-fade);
    letter-spacing: .04em;
    font-weight: 400;
}
.k-feed-time {
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-fade);
    text-align: right;
    letter-spacing: .04em;
}

.k-connect {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px;
    display: flex; flex-direction: column;
}
.k-connect-eyebrow {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--highlight);
    text-transform: uppercase; letter-spacing: .14em;
    margin-bottom: 10px;
}
.k-connect-title {
    font-size: 20px; font-weight: 700;
    letter-spacing: -.012em; margin-bottom: 6px;
    color: var(--text-bright);
}
.k-connect-deck { color: var(--text); font-size: 13.5px; line-height: 1.5; margin-bottom: 18px; }
.k-connect-cmd {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-bright);
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.k-connect-cmd .prompt { color: var(--accent); }
.k-connect-cmd .cmd { color: var(--text-bright); flex: 1; }
.k-connect-cmd .copy {
    font-family: var(--font-mono); font-size: 10.5px;
    color: var(--text-fade);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 7px;
    cursor: pointer;
    text-transform: uppercase; letter-spacing: .04em;
}
.k-connect-cmd .copy:hover { color: var(--highlight); border-color: var(--highlight); }
.k-connect-list {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase; letter-spacing: .04em;
    line-height: 1.7;
}
.k-connect-list a { color: var(--text); }
.k-connect-list a:hover { color: var(--highlight); }
.k-connect-list .key { color: var(--text-fade); }
.k-connect-cta {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px;
}
.k-connect-cta a {
    flex: 1; text-align: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-bright);
    font-weight: 600; font-size: 13.5px;
    transition: all .15s;
}
.k-connect-cta a:hover { border-color: var(--highlight); color: var(--highlight); }
.k-connect-cta a.primary {
    background: var(--highlight); color: var(--bg-body); border-color: var(--highlight);
}
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-connect-cta a.primary { color: var(--bg-body); }
.k-connect-cta a.primary:hover { background: var(--highlight-hover); color: var(--bg-body); }
[data-theme="kanso"][data-scheme="kanso-pearl"] .k-connect-cta a.primary:hover { color: var(--bg-body); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
    [data-theme="kanso"] .k-feature { grid-template-columns: 1fr; }
    [data-theme="kanso"] .k-feature-art { min-height: 220px; }
    [data-theme="kanso"] .k-cabals { grid-template-columns: repeat(2, 1fr); }
    [data-theme="kanso"] .k-lower { grid-template-columns: 1fr; }
    [data-theme="kanso"] .k-world-inner { grid-template-columns: repeat(3, 1fr); gap: 0; }
    [data-theme="kanso"] .k-hero-title { font-size: 60px; }
    [data-theme="kanso"] .k-hero-title .sub { font-size: 22px; }
}
@media (max-width: 900px) {
    [data-theme="kanso"] .k-sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s; }
    [data-theme="kanso"] .k-sidebar.open { transform: translateX(0); }
    [data-theme="kanso"] .k-topbar { left: 0; }
    [data-theme="kanso"] body > main.container,
    [data-theme="kanso"] body > .container { margin-left: 0; padding-left: 16px; padding-right: 16px; }
    [data-theme="kanso"] body > .site-footer { margin-left: 0; }
    [data-theme="kanso"] .k-world-inner { grid-template-columns: repeat(2, 1fr); }
    [data-theme="kanso"] .k-cabals { grid-template-columns: 1fr; }
}
