    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      min-height: 100vh;
      background:
        radial-gradient(ellipse at 20% 0%, rgba(60,40,10,0.3) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(40,25,5,0.3) 0%, transparent 60%),
        linear-gradient(180deg, #0c0804 0%, #12100a 50%, #0a0806 100%);
      color: #d4c498;
      font-family: 'Crimson Text', Georgia, serif;
      line-height: 1.5;
    }

    ::-webkit-scrollbar { width: 8px; }
    ::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
    ::-webkit-scrollbar-thumb { background: rgba(139,105,20,0.3); border-radius: 4px; }

    .header {
      border-bottom: 1px solid rgba(139,105,20,0.2);
      padding: 28px 32px 0;
      background: linear-gradient(180deg, rgba(20,15,8,0.9) 0%, transparent 100%);
      position: relative;
    }
    .auth-corner {
      position: fixed; top: 16px; right: 24px;
      font-size: 12px; color: #8a7a5a; text-align: right;
      font-family: 'Cinzel', serif; letter-spacing: 0.5px;
      max-width: 50%; z-index: 50;
    }
    .auth-corner a {
      color: #d4b87a; text-decoration: none;
      border: 1px solid rgba(139,105,20,0.4); padding: 6px 14px;
      border-radius: 4px; transition: all 0.15s; display: inline-block;
    }
    .auth-corner a:hover { color: #f0d688; border-color: rgba(218,165,32,0.6); background: rgba(60,40,10,0.4); }
    .auth-corner .browse-label { color: #6a5a3a; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
    .auth-corner .browse-char { color: #f0d688; font-weight: 600; font-size: 13px; margin-left: 4px; }
    .auth-corner .browse-none { color: #8a7a5a; font-style: italic; margin-left: 4px; }
    .header h1 {
      font-family: 'Cinzel', serif; font-size: 28px; font-weight: 700;
      color: #f0d688; letter-spacing: 2px; margin-bottom: 4px;
    }
    .header .subtitle {
      font-size: 13px; color: #8a7a5a; font-style: italic; margin-bottom: 20px;
    }
    .breadcrumb {
      font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 1.5px;
      text-transform: uppercase; color: #6a5a3a; margin-bottom: 10px;
    }
    .breadcrumb a {
      color: #8a7a5a; text-decoration: none; transition: color 0.15s;
    }
    .breadcrumb a:hover { color: #d4b87a; }
    .breadcrumb .sep { color: #4a3e26; margin: 0 8px; }
    .breadcrumb .current { color: #d4b87a; }

    .skill-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
    .skill-tab {
      padding: 10px 18px; border: 1px solid rgba(139,105,20,0.25);
      border-bottom: 1px solid transparent; border-radius: 4px 4px 0 0;
      background: transparent; color: #8a7a5a; cursor: pointer;
      font-size: 13px; font-family: 'Cinzel', serif; font-weight: 400;
      letter-spacing: 0.5px; transition: all 0.2s ease;
    }
    .skill-tab:hover { background: rgba(139,105,20,0.15); }
    .skill-tab.active {
      border-bottom: 2px solid #daa520;
      background: linear-gradient(180deg, rgba(60,40,10,0.5), rgba(30,20,8,0.8));
      color: #f0d688; font-weight: 600;
    }
    .skill-tab .secondary-badge {
      display: inline-block; margin-left: 8px; padding: 1px 6px;
      font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
      background: rgba(154,138,200,0.18); color: #b8a8d8;
      border: 1px solid rgba(154,138,200,0.35); border-radius: 3px;
      vertical-align: middle;
    }
    .skill-tab.active .secondary-badge {
      background: rgba(154,138,200,0.28); color: #d4c0f0;
      border-color: rgba(154,138,200,0.55);
    }

    .secondary-note {
      background: rgba(60,40,60,0.22);
      border: 1px solid rgba(154,138,200,0.25);
      border-left: 3px solid rgba(154,138,200,0.6);
      padding: 10px 14px; margin: 0 0 16px; border-radius: 4px;
      font-size: 12.5px; color: #b8a8d0; line-height: 1.55;
    }
    .secondary-note .sn-label {
      display: inline-block; margin-right: 8px; padding: 1px 7px;
      font-family: 'Cinzel', serif; font-size: 10px;
      letter-spacing: 1.2px; text-transform: uppercase;
      background: rgba(154,138,200,0.22); color: #d4c0f0;
      border-radius: 3px;
    }
    .secondary-note a { color: #d4b87a; text-decoration: underline; }
    .secondary-note a:hover { color: #f0d688; }

    .search-bar { margin-bottom: 20px; position: relative; }
    .search-bar input {
      width: 100%; padding: 10px 16px 10px 38px;
      background: rgba(20,15,8,0.8); border: 1px solid rgba(139,105,20,0.3);
      border-radius: 6px; color: #d4c498; font-family: 'Crimson Text', Georgia, serif;
      font-size: 14px; outline: none; transition: border-color 0.2s;
    }
    .search-bar input::placeholder { color: #6a5a3a; }
    .search-bar input:focus { border-color: rgba(218,165,32,0.6); }
    .search-icon {
      position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
      color: #6a5a3a; font-size: 14px; pointer-events: none;
    }
    .search-clear {
      position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
      background: none; border: none; color: #6a5a3a; font-size: 16px;
      cursor: pointer; padding: 2px 6px; display: none;
    }
    .search-clear:hover { color: #d4b87a; }
    .search-clear.visible { display: block; }
    .search-count { font-size: 11px; color: #6a5a3a; margin-top: 6px; font-style: italic; }

    .group-toggle {
      display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
    }
    .group-toggle-label {
      font-size: 11px; color: #6a5a3a; text-transform: uppercase;
      letter-spacing: 1px; font-family: 'Cinzel', serif;
    }
    .group-toggle-btns { display: flex; gap: 0; }
    .group-toggle-btn {
      padding: 4px 12px; font-size: 11px; font-family: 'Cinzel', serif;
      border: 1px solid rgba(139,105,20,0.3); background: transparent;
      color: #8a7a5a; cursor: pointer; transition: all 0.15s; letter-spacing: 0.3px;
    }
    .group-toggle-btn:first-child { border-radius: 4px 0 0 4px; }
    .group-toggle-btn:last-child { border-radius: 0 4px 4px 0; border-left: none; }
    .group-toggle-btn:hover { background: rgba(139,105,20,0.1); }
    .group-toggle-btn.active {
      background: rgba(139,105,20,0.25); color: #f0d688;
      border-color: rgba(218,165,32,0.5);
    }
    .group-toggle-btn.active + .group-toggle-btn { border-left: 1px solid rgba(218,165,32,0.5); }

    .content {
      padding: 24px 32px; display: flex; gap: 28px; align-items: flex-start;
    }
    .list-area { flex: 1 1 0; min-width: 0; position: relative; padding-bottom: 40px; }
    .list-area svg.connections {
      position: absolute; top: 0; left: 0; width: 100%; height: 100%;
      pointer-events: none; z-index: 2; overflow: visible;
    }
    .detail-area { width: 380px; flex-shrink: 0; position: sticky; top: 24px; }

    .tier-section { margin-bottom: 24px; }
    .tier-header {
      font-size: 10px; text-transform: uppercase; letter-spacing: 2px;
      font-family: 'Cinzel', serif; margin-bottom: 12px; padding-bottom: 6px;
      border-bottom: 1px solid rgba(139,105,20,0.15);
    }
    .tier-header.t0 { color: #7a9a5a; }
    .tier-header.t1 { color: #c8956c; }
    .tier-header.t2 { color: #9a8ac8; }
    .tier-header.t3 { color: #c88a8a; }

    .group-section { margin-bottom: 12px; }
    .group-header {
      display: flex; align-items: center; gap: 8px; cursor: pointer;
      padding: 6px 10px; border-radius: 4px; margin-bottom: 6px;
      transition: background 0.15s; user-select: none;
    }
    .group-header:hover { background: rgba(139,105,20,0.1); }
    .group-chevron {
      font-size: 10px; color: #8a7a5a; transition: transform 0.2s;
      width: 12px; text-align: center;
    }
    .group-chevron.collapsed { transform: rotate(-90deg); }
    .group-name { font-family: 'Cinzel', serif; font-size: 12px; color: #b8a878; letter-spacing: 0.5px; }
    .group-count { font-size: 11px; color: #6a5a3a; margin-left: auto; }
    .group-body { overflow: hidden; transition: max-height 0.3s ease; }
    .group-body.collapsed { max-height: 0 !important; }

    .recipe-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 6px; padding: 0 0 4px 20px;
    }

    .recipe-card {
      cursor: pointer; padding: 8px 10px; border-radius: 4px;
      border: 1px solid rgba(139,105,20,0.25);
      background: linear-gradient(135deg, rgba(25,18,10,0.8), rgba(35,25,12,0.8));
      transition: all 0.2s ease; display: flex; flex-direction: column; gap: 2px;
    }
    .recipe-card:hover {
      border-color: rgba(218,165,32,0.5);
      background: linear-gradient(135deg, rgba(35,25,14,0.9), rgba(50,35,18,0.9));
    }
    .recipe-card.selected {
      border: 2px solid #daa520;
      background: linear-gradient(135deg, rgba(40,28,16,0.95), rgba(60,40,20,0.95));
      box-shadow: 0 0 12px rgba(218,165,32,0.2);
    }
    .recipe-card.highlighted {
      border-color: rgba(218,165,32,0.45);
      background: linear-gradient(135deg, rgba(35,25,14,0.85), rgba(50,35,18,0.85));
    }
    .recipe-card .rc-name { font-size: 12px; font-weight: 600; color: #d4b87a; line-height: 1.25; }
    .recipe-card.selected .rc-name { color: #f0d688; }
    .recipe-card .rc-meta { font-size: 10px; color: #7a6a4a; display: flex; gap: 6px; }
    .recipe-card .rc-qty { color: #8a7a5a; }

    .tier0-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; padding: 0 0 0 20px; }
    .tier0-card {
      cursor: pointer; padding: 10px 14px; border-radius: 6px;
      border: 1px solid rgba(122,154,90,0.35);
      background: linear-gradient(135deg, rgba(25,30,15,0.8), rgba(35,40,20,0.8));
      transition: all 0.2s ease; min-width: 130px; text-align: center;
    }
    .tier0-card:hover { border-color: rgba(122,154,90,0.6); transform: translateY(-1px); }
    .tier0-card.selected { border: 2px solid #7a9a5a; box-shadow: 0 0 12px rgba(122,154,90,0.2); }
    .tier0-card .rc-name { font-size: 13px; font-weight: 600; color: #a8c888; line-height: 1.3; }
    .tier0-card.selected .rc-name { color: #c8e8a8; }
    .tier0-card .rc-meta { font-size: 10px; color: #6a7a4a; margin-top: 3px; }

    /* ── Eureka'd recipes — these glow gold so they feel earned ────────────── */
    @keyframes eurekaShimmer {
      0%, 100% { box-shadow: 0 0 0 1px rgba(218,165,32,0.55), 0 0 12px rgba(218,165,32,0.18); }
      50%      { box-shadow: 0 0 0 1px rgba(240,214,136,0.85), 0 0 18px rgba(240,214,136,0.32); }
    }
    .recipe-card.eureka, .tier0-card.eureka {
      border-color: rgba(218,165,32,0.6);
      background: linear-gradient(135deg, rgba(50,35,15,0.95), rgba(70,50,22,0.95));
      animation: eurekaShimmer 3.6s ease-in-out infinite;
      position: relative;
    }
    .recipe-card.eureka .rc-name, .tier0-card.eureka .rc-name { color: #f0d688; }
    .recipe-card.eureka::after, .tier0-card.eureka::after {
      content: '✦';
      position: absolute; top: 2px; right: 4px;
      font-size: 10px; color: #f0d688;
      text-shadow: 0 0 6px rgba(240,214,136,0.7);
      pointer-events: none;
    }
    .recipe-card.eureka.selected, .tier0-card.eureka.selected {
      border-color: #f0d688;
      box-shadow: 0 0 0 1px #f0d688, 0 0 20px rgba(240,214,136,0.45);
      animation: none;
    }

    /* ── Reverse-engineered recipes — a sibling unlock state to eureka.
       Cyan/teal accent (blueprint-flavored) keeps it visually distinct from
       eureka's gold. A small ⚙ glyph sits in the top-left so eureka's ✦ in
       the top-right can coexist on a recipe unlocked both ways. */
    @keyframes reversedShimmer {
      0%, 100% { box-shadow: 0 0 0 1px rgba(90,180,200,0.5),  0 0 10px rgba(90,180,200,0.15); }
      50%      { box-shadow: 0 0 0 1px rgba(150,220,232,0.8), 0 0 16px rgba(150,220,232,0.28); }
    }
    .recipe-card.reversed, .tier0-card.reversed {
      border-color: rgba(90,180,200,0.6);
      background: linear-gradient(135deg, rgba(15,32,38,0.95), rgba(22,48,56,0.95));
      animation: reversedShimmer 3.8s ease-in-out infinite;
    }
    .recipe-card.reversed .rc-name, .tier0-card.reversed .rc-name { color: #aee2ec; }
    .recipe-card.reversed::before, .tier0-card.reversed::before {
      content: '⚙';
      position: absolute; top: 2px; left: 4px;
      font-size: 10px; color: #aee2ec;
      text-shadow: 0 0 6px rgba(150,220,232,0.7);
      pointer-events: none;
    }
    .recipe-card.reversed.selected, .tier0-card.reversed.selected {
      border-color: #aee2ec;
      box-shadow: 0 0 0 1px #aee2ec, 0 0 20px rgba(150,220,232,0.45);
      animation: none;
    }
    /* Eureka + reversed: gold border wins (discovery is the headline state) but
       the cyan glyph still calls out the alternate unlock route. */
    .recipe-card.eureka.reversed, .tier0-card.eureka.reversed {
      border-color: rgba(218,165,32,0.6);
      background: linear-gradient(135deg, rgba(40,32,15,0.95), rgba(60,46,22,0.95));
      animation: eurekaShimmer 3.6s ease-in-out infinite;
    }

    /* Detail-panel "You reverse-engineered this!" banner. */
    @keyframes reversedBannerSheen {
      0%   { background-position: -200% 0; }
      100% { background-position:  200% 0; }
    }
    .reversed-banner {
      margin: 0 0 16px;
      padding: 12px 16px;
      border-radius: 6px;
      border: 1px solid rgba(90,180,200,0.6);
      background:
        linear-gradient(110deg,
          transparent 0%, transparent 35%,
          rgba(150,220,232,0.16) 50%,
          transparent 65%, transparent 100%),
        linear-gradient(135deg, rgba(12,32,40,0.85), rgba(20,55,68,0.85));
      background-size: 250% 100%, 100% 100%;
      animation: reversedBannerSheen 5s linear infinite;
      box-shadow: 0 0 18px rgba(90,180,200,0.18), inset 0 1px 0 rgba(200,240,248,0.1);
      display: flex; align-items: center; gap: 12px;
    }
    .reversed-banner .runes {
      font-size: 20px; color: #aee2ec;
      text-shadow: 0 0 8px rgba(150,220,232,0.7);
      letter-spacing: 4px; flex-shrink: 0;
    }
    .reversed-banner .text {
      font-family: 'Cinzel', serif; color: #aee2ec;
      font-size: 13px; line-height: 1.4; letter-spacing: 0.5px;
    }
    .reversed-banner .text strong {
      font-weight: 700; font-size: 14px;
      color: #e0f4f8; letter-spacing: 1px;
    }
    .reversed-banner .text .sub {
      display: block; font-family: 'Crimson Text', Georgia, serif;
      font-style: italic; color: #88c4d0;
      font-size: 12px; letter-spacing: 0; margin-top: 2px;
    }

    /* ── Crafted-count tiers — complement eureka by showing "you've made this" ─
       Four tiers escalate in saturation and warmth so the player can spot at a
       glance which recipes they've poured time into. A small numeric pip sits
       in the bottom-right of the card; the border picks up a tinted accent.
       Eureka's gold border + ✦ still wins for discovery — these layers stack. */
    .recipe-card .rc-craft-pip, .tier0-card .rc-craft-pip {
      position: absolute; bottom: 2px; right: 4px;
      font-size: 9px; font-weight: 700; font-family: 'Cinzel', serif;
      letter-spacing: 0.5px; padding: 1px 5px; border-radius: 8px;
      pointer-events: none; line-height: 1.2;
    }
    .recipe-card, .tier0-card { position: relative; }

    /* Tier 1: 1+ crafts — bronze "you have made this" */
    .recipe-card.crafted-t1, .tier0-card.crafted-t1 {
      border-color: rgba(176,130,80,0.55);
    }
    .recipe-card.crafted-t1 .rc-craft-pip, .tier0-card.crafted-t1 .rc-craft-pip {
      color: #e8c498; background: rgba(120,75,30,0.65);
      border: 1px solid rgba(176,130,80,0.55);
    }

    /* Tier 2: 10+ crafts — steel-blue "made a lot" */
    .recipe-card.crafted-t2, .tier0-card.crafted-t2 {
      border-color: rgba(120,168,200,0.6);
      box-shadow: 0 0 8px rgba(120,168,200,0.12);
    }
    .recipe-card.crafted-t2 .rc-name, .tier0-card.crafted-t2 .rc-name { color: #c8dcec; }
    .recipe-card.crafted-t2 .rc-craft-pip, .tier0-card.crafted-t2 .rc-craft-pip {
      color: #e0eef8; background: rgba(40,80,120,0.7);
      border: 1px solid rgba(120,168,200,0.7);
    }

    /* Tier 3: 50+ crafts — emerald "rockstar" with gentle glow */
    @keyframes craftedShimmerT3 {
      0%, 100% { box-shadow: 0 0 0 1px rgba(120,200,140,0.45), 0 0 10px rgba(120,200,140,0.18); }
      50%      { box-shadow: 0 0 0 1px rgba(160,232,176,0.7),  0 0 16px rgba(160,232,176,0.3); }
    }
    .recipe-card.crafted-t3, .tier0-card.crafted-t3 {
      border-color: rgba(120,200,140,0.65);
      animation: craftedShimmerT3 4.2s ease-in-out infinite;
    }
    .recipe-card.crafted-t3 .rc-name, .tier0-card.crafted-t3 .rc-name { color: #b8f0c4; }
    .recipe-card.crafted-t3 .rc-craft-pip, .tier0-card.crafted-t3 .rc-craft-pip {
      color: #e8ffe8; background: rgba(30,90,50,0.75);
      border: 1px solid rgba(160,232,176,0.75);
    }

    /* Tier 4: 250+ crafts — fiery "MANIAC" with active pulse */
    @keyframes craftedPulseT4 {
      0%, 100% { box-shadow: 0 0 0 1px rgba(255,120,60,0.7),  0 0 14px rgba(255,90,40,0.35); }
      50%      { box-shadow: 0 0 0 1px rgba(255,180,90,0.95), 0 0 22px rgba(255,140,60,0.6); }
    }
    .recipe-card.crafted-t4, .tier0-card.crafted-t4 {
      border-color: rgba(255,140,60,0.8);
      background: linear-gradient(135deg, rgba(60,20,10,0.95), rgba(80,28,12,0.95));
      animation: craftedPulseT4 1.8s ease-in-out infinite;
    }
    .recipe-card.crafted-t4 .rc-name, .tier0-card.crafted-t4 .rc-name { color: #ffd9a8; }
    .recipe-card.crafted-t4 .rc-craft-pip, .tier0-card.crafted-t4 .rc-craft-pip {
      color: #fff4d8; background: rgba(180,60,20,0.85);
      border: 1px solid rgba(255,180,90,0.9);
      text-shadow: 0 0 4px rgba(255,180,90,0.6);
    }

    /* Selected state keeps the gold ring authoritative but preserves the pip. */
    .recipe-card.selected.crafted-t3, .tier0-card.selected.crafted-t3,
    .recipe-card.selected.crafted-t4, .tier0-card.selected.crafted-t4 {
      animation: none;
    }

    /* Detail-panel "You've crafted this X times" banner. */
    .crafted-banner {
      margin: 0 0 16px;
      padding: 10px 14px;
      border-radius: 6px;
      display: flex; align-items: center; gap: 12px;
      font-family: 'Cinzel', serif; letter-spacing: 0.5px;
    }
    .crafted-banner .badge {
      flex-shrink: 0; padding: 4px 10px; border-radius: 4px;
      font-size: 13px; font-weight: 700; letter-spacing: 1px;
    }
    .crafted-banner .text {
      font-size: 12px; line-height: 1.4;
    }
    .crafted-banner .text strong {
      font-size: 13px; font-weight: 700; letter-spacing: 1px;
      display: block; margin-bottom: 1px;
    }
    .crafted-banner .text .sub {
      font-family: 'Crimson Text', Georgia, serif;
      font-style: italic; font-size: 11.5px; letter-spacing: 0;
    }
    .crafted-banner.t1 {
      border: 1px solid rgba(176,130,80,0.55);
      background: linear-gradient(135deg, rgba(40,28,16,0.85), rgba(60,40,20,0.85));
      color: #e8c498;
    }
    .crafted-banner.t1 .badge { background: rgba(120,75,30,0.7); color: #ffe4c0; }
    .crafted-banner.t1 .text strong { color: #ffe4c0; }
    .crafted-banner.t1 .text .sub { color: #c8a878; }

    .crafted-banner.t2 {
      border: 1px solid rgba(120,168,200,0.6);
      background: linear-gradient(135deg, rgba(18,28,40,0.85), rgba(24,40,60,0.85));
      color: #c8dcec;
    }
    .crafted-banner.t2 .badge { background: rgba(40,80,120,0.75); color: #e0eef8; }
    .crafted-banner.t2 .text strong { color: #e0eef8; }
    .crafted-banner.t2 .text .sub { color: #a8c0d4; }

    .crafted-banner.t3 {
      border: 1px solid rgba(160,232,176,0.65);
      background: linear-gradient(135deg, rgba(15,32,20,0.85), rgba(22,50,30,0.85));
      color: #b8f0c4;
      box-shadow: 0 0 14px rgba(120,200,140,0.18);
    }
    .crafted-banner.t3 .badge { background: rgba(30,90,50,0.8); color: #e8ffe8; }
    .crafted-banner.t3 .text strong { color: #e8ffe8; }
    .crafted-banner.t3 .text .sub { color: #98d0a8; }

    .crafted-banner.t4 {
      border: 1px solid rgba(255,180,90,0.85);
      background: linear-gradient(135deg, rgba(60,20,8,0.9), rgba(90,32,12,0.9));
      color: #ffd9a8;
      animation: craftedPulseT4 1.8s ease-in-out infinite;
    }
    .crafted-banner.t4 .badge {
      background: rgba(180,60,20,0.9); color: #fff4d8;
      text-shadow: 0 0 6px rgba(255,180,90,0.7);
    }
    .crafted-banner.t4 .text strong { color: #fff4d8; letter-spacing: 1.5px; }
    .crafted-banner.t4 .text .sub { color: #e8b890; }

    /* Detail-panel "You Eureka'd this!" banner. */
    @keyframes eurekaBannerSheen {
      0%   { background-position: -200% 0; }
      100% { background-position:  200% 0; }
    }
    .eureka-banner {
      margin: 0 0 16px;
      padding: 12px 16px;
      border-radius: 6px;
      border: 1px solid rgba(218,165,32,0.6);
      background:
        linear-gradient(110deg,
          transparent 0%, transparent 35%,
          rgba(240,214,136,0.18) 50%,
          transparent 65%, transparent 100%),
        linear-gradient(135deg, rgba(60,42,12,0.85), rgba(90,62,18,0.85));
      background-size: 250% 100%, 100% 100%;
      animation: eurekaBannerSheen 5s linear infinite;
      box-shadow: 0 0 18px rgba(218,165,32,0.22), inset 0 1px 0 rgba(255,235,170,0.15);
      display: flex; align-items: center; gap: 12px;
    }
    .eureka-banner .runes {
      font-size: 20px; color: #f0d688;
      text-shadow: 0 0 8px rgba(240,214,136,0.7);
      letter-spacing: 4px; flex-shrink: 0;
    }
    .eureka-banner .text {
      font-family: 'Cinzel', serif; color: #f0d688;
      font-size: 13px; line-height: 1.4; letter-spacing: 0.5px;
    }
    .eureka-banner .text strong {
      font-weight: 700; font-size: 14px;
      color: #fff4c8; letter-spacing: 1px;
    }
    .eureka-banner .text .sub {
      display: block; font-family: 'Crimson Text', Georgia, serif;
      font-style: italic; color: #d4b87a;
      font-size: 12px; letter-spacing: 0; margin-top: 2px;
    }

    /* ── Detail Panel ───────────────────────────────────────── */
    .detail-panel {
      background: linear-gradient(180deg, #1a1208 0%, #0f0a04 100%);
      border: 1px solid rgba(139,105,20,0.5); border-radius: 8px; padding: 24px;
      position: relative;
      box-shadow: 0 4px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
      animation: fadeIn 0.3s ease;
    }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .detail-close {
      position: absolute; top: 6px; right: 8px; background: none; border: none;
      color: #8a7a5a; font-size: 16px; cursor: pointer; padding: 2px 6px; line-height: 1;
    }
    .detail-close:hover { color: #d4b87a; }
    .detail-share, .detail-image {
      position: absolute; top: 6px;
      width: 24px; height: 22px; padding: 0;
      display: inline-flex; align-items: center; justify-content: center;
      background: transparent; border: 1px solid rgba(139,105,20,0.4);
      color: #d4b87a; cursor: pointer; border-radius: 4px; transition: all 0.15s;
    }
    .detail-share { right: 32px; }
    .detail-image { right: 60px; }
    .detail-share svg, .detail-image svg { width: 12px; height: 12px; display: block; }
    .detail-share:hover, .detail-image:hover { color: #f0d688; border-color: rgba(218,165,32,0.6); background: rgba(80,55,15,0.4); }
    .detail-share.copied, .detail-image.copied { color: #a8c888; border-color: rgba(122,154,90,0.6); }
    .share-toast {
      position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
      background: rgba(20,15,8,0.95); border: 1px solid rgba(218,165,32,0.5);
      color: #f0d688; padding: 10px 18px; border-radius: 6px;
      font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 0.5px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.5); z-index: 100;
      opacity: 0; pointer-events: none; transition: opacity 0.2s;
    }
    .share-toast.visible { opacity: 1; }
    .detail-locked {
      text-align: center; padding: 48px 24px; color: #c88a8a;
      border: 1px solid rgba(200,138,138,0.4); border-radius: 8px;
      background: linear-gradient(180deg, rgba(40,20,20,0.6) 0%, rgba(20,10,10,0.8) 100%);
    }
    .detail-locked .icon { font-size: 36px; margin-bottom: 14px; opacity: 0.6; }
    .detail-locked .title {
      font-family: 'Cinzel', serif; font-size: 17px; color: #e0a0a0;
      margin-bottom: 8px; letter-spacing: 1px;
    }
    .detail-locked .hint { font-size: 13px; color: #8a6a6a; font-style: italic; line-height: 1.6; }
    .detail-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; padding-right: 56px; }
    .detail-header h3 {
      margin: 0; color: #f0d688; font-size: 20px; font-family: 'Cinzel', serif; font-weight: 700;
      flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; line-height: 1.25;
    }
    .tier-badge {
      font-size: 11px; padding: 2px 8px; border-radius: 3px;
      text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
    }
    .tier-badge.t0 { color: #7a9a5a; border: 1px solid rgba(122,154,90,0.4); }
    .tier-badge.t1 { color: #c8956c; border: 1px solid rgba(200,149,108,0.4); }
    .tier-badge.t2 { color: #9a8ac8; border: 1px solid rgba(154,138,200,0.4); }
    .tier-badge.t3 { color: #c88a8a; border: 1px solid rgba(200,138,138,0.4); }
    .detail-tag { font-size: 11px; color: #6a5a3a; margin-bottom: 14px; font-style: italic; }
    .detail-desc {
      color: #b8a878; font-size: 13.5px; line-height: 1.7; margin: 0 0 20px 0;
      font-style: italic; border-left: 2px solid rgba(139,105,20,0.3); padding-left: 12px;
      white-space: pre-line;
    }
    .detail-stats {
      display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
      margin-bottom: 20px; font-size: 12px;
    }
    .detail-stats span { color: #8a7a5a; }
    .detail-stats strong { color: #d4b87a; font-weight: 400; }
    .detail-section-title {
      color: #c8956c; font-size: 12px; text-transform: uppercase;
      letter-spacing: 1.5px; margin-bottom: 8px; font-family: 'Cinzel', serif;
    }
    .detail-section { margin-bottom: 18px; }
    .pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
    .pill-ingredient {
      background: rgba(60,45,20,0.6); border: 1px solid rgba(139,105,20,0.25);
      border-radius: 4px; padding: 4px 10px; font-size: 12px; color: #d4c498;
    }
    .pill-discover {
      background: rgba(80,50,20,0.5); border: 1px solid rgba(218,165,32,0.25);
      border-radius: 4px; padding: 4px 10px; font-size: 12px; color: #f0d688;
      cursor: pointer; transition: background 0.15s;
    }
    .pill-discover:hover { background: rgba(100,65,25,0.6); }
    .pill-discover.stub {
      background: rgba(60,40,60,0.4); border-color: rgba(154,138,200,0.3); color: #b8a0d8;
    }
    .pill-discover.stub:hover { background: rgba(80,55,80,0.5); }
    .pill-source {
      background: rgba(50,40,20,0.5); border: 1px solid rgba(139,105,20,0.25);
      border-radius: 4px; padding: 4px 10px; font-size: 12px; color: #d4b87a;
      cursor: pointer; transition: background 0.15s;
    }
    .pill-source:hover { background: rgba(65,50,25,0.6); }
    .prop-row {
      display: flex; justify-content: space-between;
      background: rgba(40,60,20,0.3); border: 1px solid rgba(80,120,40,0.2);
      border-radius: 4px; padding: 5px 10px; font-size: 12px; margin-bottom: 4px;
    }
    .prop-name { color: #8ab860; }

    .stat-block {
      background: rgba(30,40,55,0.35); border: 1px solid rgba(90,120,160,0.22);
      border-radius: 4px; overflow: hidden;
    }
    .stat-row {
      display: flex; justify-content: space-between; gap: 12px;
      padding: 5px 10px; font-size: 12px;
      border-bottom: 1px solid rgba(90,120,160,0.12);
    }
    .stat-row:last-child { border-bottom: none; }
    .stat-label { color: #8a9bb8; }
    .stat-value { color: #cdddf0; text-align: right; }
    .stat-note { font-style: italic; }
    .stat-note .stat-value { color: #9aa8bc; text-align: left; }
    .stat-row.has-info { cursor: pointer; transition: background 0.15s; }
    .stat-row.has-info:hover { background: rgba(90,120,160,0.12); }
    .info-dot {
      display: inline-flex; align-items: center; justify-content: center;
      width: 13px; height: 13px; margin-left: 6px; border-radius: 50%;
      font-size: 9px; font-weight: 700; line-height: 1; vertical-align: 1px;
      color: #bcd0ea; background: rgba(90,120,160,0.25);
      border: 1px solid rgba(120,150,190,0.4); transition: all 0.15s;
    }
    .stat-row.has-info:hover .info-dot, .stat-row.open .info-dot {
      color: #1a2230; background: #9bb6d6; border-color: #9bb6d6;
    }
    .stat-info {
      display: none; font-size: 11.5px; line-height: 1.55; color: #9fb0c6;
      padding: 0 10px; background: rgba(20,28,40,0.5);
      border-bottom: 1px solid rgba(90,120,160,0.12);
    }
    .stat-info.open { display: block; padding: 8px 10px; }
    .stat-info .wiki-link {
      display: block; margin-top: 8px; font-size: 11px;
      color: #c8956c; text-decoration: none; border-bottom: 1px dotted rgba(200,149,108,0.5);
      text-align:right;
    }
    .stat-info .wiki-link:hover { color: #e0b888; border-bottom-color: rgba(224,184,136,0.8); }

    .detail-empty {
      text-align: center; padding: 48px 24px; color: #6a5a3a;
      font-size: 13px; font-style: italic;
      border: 1px dashed rgba(139,105,20,0.2); border-radius: 8px;
    }
    .detail-empty .icon { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }

    .detail-loading {
      text-align: center; padding: 20px; color: #8a7a5a;
      font-size: 12px; font-style: italic; margin-top: 12px;
    }
    .detail-loading .mini-spinner {
      display: inline-block; width: 14px; height: 14px;
      border: 2px solid rgba(139,105,20,0.2); border-top-color: #daa520;
      border-radius: 50%; animation: spin 0.8s linear infinite;
      vertical-align: middle; margin-right: 8px;
    }

    .stub-teaser {
      text-align: center; padding: 30px 16px; margin-top: 12px;
      background: rgba(60,40,60,0.15); border: 1px dashed rgba(154,138,200,0.3);
      border-radius: 8px; color: #9a8ac8; font-size: 13px; font-style: italic;
      line-height: 1.6;
    }
    .stub-teaser .teaser-icon { font-size: 28px; margin-bottom: 10px; opacity: 0.5; }

    .no-results { text-align: center; padding: 40px 20px; color: #6a5a3a; font-style: italic; }

    .loading {
      text-align: center; padding: 80px 20px; color: #8a7a5a; font-size: 15px;
    }
    .loading .spinner {
      display: inline-block; width: 28px; height: 28px;
      border: 3px solid rgba(139,105,20,0.2); border-top-color: #daa520;
      border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .error-msg { text-align: center; padding: 60px 20px; color: #b85050; font-size: 14px; }

    .auth-corner .nav-link { margin-right: 6px; }

    .login-overlay {
      display: none; position: fixed; inset: 0; z-index: 1000;
      background: rgba(8,6,3,0.75); backdrop-filter: blur(4px);
      align-items: center; justify-content: center; padding: 20px;
    }
    .login-overlay.open { display: flex; }
    .login-modal {
      width: 100%; max-width: 380px; padding: 28px 28px 24px;
      background: linear-gradient(180deg, #1a140a 0%, #120e07 100%);
      border: 1px solid rgba(139,105,20,0.4); border-radius: 6px;
      box-shadow: 0 18px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(218,165,32,0.08) inset;
      color: #d4c498; position: relative;
    }
    .login-modal h2 {
      font-family: 'Cinzel', serif; font-size: 20px; font-weight: 700;
      color: #f0d688; letter-spacing: 2px; text-transform: uppercase;
      margin-bottom: 4px; text-align: center;
    }
    .login-modal .login-sub {
      text-align: center; font-size: 12px; color: #8a7a5a;
      font-style: italic; margin-bottom: 20px;
    }
    .login-modal label {
      display: block; font-family: 'Cinzel', serif; font-size: 10px;
      letter-spacing: 1.5px; text-transform: uppercase;
      color: #8a7a5a; margin: 12px 0 6px;
    }
    .login-modal input[type="text"],
    .login-modal input[type="password"] {
      width: 100%; padding: 9px 12px;
      background: rgba(20,15,8,0.8); border: 1px solid rgba(139,105,20,0.3);
      border-radius: 4px; color: #d4c498;
      font-family: 'Crimson Text', Georgia, serif; font-size: 14px;
      outline: none; transition: border-color 0.2s;
    }
    .login-modal input[type="text"]:focus,
    .login-modal input[type="password"]:focus { border-color: rgba(218,165,32,0.6); }
    .login-modal .remember {
      display: flex; align-items: center; gap: 6px;
      margin-top: 14px; font-size: 12px; color: #8a7a5a;
    }
    .login-modal .remember input { accent-color: #daa520; }
    .login-modal .actions {
      display: flex; justify-content: space-between; align-items: center;
      gap: 12px; margin-top: 18px;
    }
    .login-modal button[type="submit"] {
      padding: 9px 22px; background: linear-gradient(180deg, rgba(60,40,10,0.7), rgba(30,20,8,0.9));
      border: 1px solid rgba(218,165,32,0.5); border-radius: 4px;
      color: #f0d688; font-family: 'Cinzel', serif; font-size: 12px;
      letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
      transition: all 0.15s;
    }
    .login-modal button[type="submit"]:hover {
      background: linear-gradient(180deg, rgba(80,55,15,0.8), rgba(40,28,10,0.9));
      border-color: rgba(218,165,32,0.8);
    }
    .login-modal .login-close {
      position: absolute; top: 10px; right: 12px;
      background: none; border: none; color: #6a5a3a;
      font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px;
    }
    .login-modal .login-close:hover { color: #d4b87a; }
    .login-modal .login-footer {
      margin-top: 16px; text-align: center; font-size: 12px; color: #6a5a3a;
    }
    .login-modal .login-footer a { color: #8a7a5a; text-decoration: none; }
    .login-modal .login-footer a:hover { color: #d4b87a; }

    @media (max-width: 900px) {
      .content { flex-direction: column; }
      .detail-area { width: 100%; position: static; }
      .header { padding: 20px 16px 0; }
      .content { padding: 16px; }
      .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    }
    @media (max-width: 600px) {
      .auth-corner .nav-link { display: none; }
    }
