    :root {
      --bg: #F6F8FB;
      --panel: #FFFFFF;
      --panel-strong: #FFFFFF;
      --accent: #2563EB;
      --accent-strong: #2563EB;
      --text: #1A1F2B;
      --muted: #4B5565;
      --line: #E6EAF0;
      --card: #FFFFFF;
    }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 30;
      backdrop-filter: blur(10px);
      background: rgba(10, 23, 40, 0.92);
      border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    }
    .topbar-inner {
      max-width: 1020px;
      margin: 0 auto;
      padding: 10px 20px;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 12px;
    }
    .topbar a { text-decoration: none; }
    .brand {
      display: inline-flex;
      align-items: baseline;
      gap: 10px;
      color: #ffffff;
      font-weight: 950;
      letter-spacing: 0.8px;
      white-space: nowrap;
      font-size: 18px;
    }
    nav.links {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: flex-start;
      font-size: 13.5px;
      font-weight: 750;
      color: rgba(255,255,255,0.78);
      margin-left: 12px;
      flex: 1 1 auto;
    }
    nav.links a { color: rgba(255,255,255,0.78); font-weight: 800; position: relative; padding: 10px 6px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; }
    nav.links a:hover { color: #fff; }
    nav.links a.active { color: #fff; }
    nav.links a.active::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 5px;
      height: 3px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.92);
    }
    .nav-icon {
      display: inline-flex;
      width: 18px;
      height: 18px;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      opacity: 0.85;
    }
    nav.links a:hover .nav-icon,
    nav.links a.active .nav-icon { opacity: 1; }
    .nav-icon img {
      width: 18px;
      height: 18px;
      display: block;
      object-fit: contain;
      /* アイコンは黒系PNGなのでヘッダ上では白寄りに反転 */
      filter: invert(1) brightness(1.1);
    }
    .actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
      margin-left: auto;
    }
    .nav-toggle { display: none !important; }
    .btn {
      border: 1px solid rgba(255,255,255,0.22);
      background: rgba(255,255,255,0.08);
      color: #fff;
      height: 34px;
      padding: 0 12px;
      border-radius: 11px;
      cursor: pointer;
      font-weight: 850;
      letter-spacing: 0.2px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
    }
    .btn:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
    .btn.primary {
      border-color: var(--accent);
      background: var(--accent);
      color: #fff;
    }
    #login-link.btn {
      border-color: rgba(255,255,255,0.34);
      background: rgba(255,255,255,0.10);
    }
    #login-link.btn:hover { background: rgba(255,255,255,0.16); }
    .btn.gold { display: none; }
    .nav-hidden { display: none !important; }
    .menu { position: relative; display: inline-flex; align-items: center; }
    .menu-panel {
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      min-width: 220px;
      background: rgba(10, 23, 40, 0.98);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 14px;
      padding: 10px;
      box-shadow: 0 16px 36px rgba(0,0,0,0.45);
      display: none;
    }
    .menu.open .menu-panel { display: block; }
    .menu-panel a, .menu-panel button {
      width: 100%;
      text-align: left;
      display: block;
      border: 0;
      background: transparent;
      color: rgba(240, 250, 255, 0.92);
      padding: 10px 10px;
      border-radius: 10px;
      font-weight: 800;
      cursor: pointer;
    }
    .menu-panel a:hover, .menu-panel button:hover {
      background: rgba(98, 231, 214, 0.10);
    }

    /* スマホ（小さめ + タッチ）だけヘッダを折りたたむ（PCの狭幅表示では出さない） */
    @media (max-width: 620px) and (hover: none) and (pointer: coarse) {
      .topbar-inner {
        padding: 10px 14px;
        flex-wrap: wrap;
        align-items: center;
      }
      nav.links {
        order: 3;
        width: 100%;
        margin-left: 0;
        padding: 6px 0 10px;
        display: none;
        flex-direction: column;
        gap: 2px;
      }
      .topbar.is-open nav.links { display: flex; }
      nav.links a { width: 100%; padding: 12px 10px; }
      nav.links a.active::after { left: 12px; right: 12px; }
      .actions {
        order: 2;
        gap: 8px;
      }
      .btn { height: 32px; padding: 0 10px; border-radius: 10px; }
      .nav-toggle { display: inline-flex !important; }
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: "Bahnschrift", "Segoe UI Variable", "Yu Gothic UI", sans-serif;
      background: var(--bg);
      color: var(--text);
    }
    /* フォント統一は詳細検索内だけ（見た目の違和感対策） */
    .detail-panel button,
    .detail-panel input,
    .detail-panel select,
    .detail-panel textarea {
      font: inherit;
      font-size: 14px;
    }
    .page { max-width: 1020px; margin: 0 auto; padding: 26px 20px 88px; }
    header h1 { margin: 0; letter-spacing: 1px; font-size: 32px; font-weight: 850; color: #eaf7ff; }
    header .title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
    header .meta { color: #d4e7f6; font-size: 13.5px; line-height: 1.6; font-weight: 650; }
    .last-updated { color: var(--muted); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
    .filter-actions { margin: 4px 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
    .filter-actions button {
      border: 1px solid #2f5f79;
      background: #122b40;
      color: #eaf7ff;
      height: 32px;
      padding: 0 14px;
      border-radius: 10px;
      cursor: pointer;
      letter-spacing: 0.3px;
      font-weight: 750;
      transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    }
    .filter-actions button:hover { background: #1a3650; }
    .scenario-switch { margin: 12px 0 12px; display: flex; gap: 10px; flex-wrap: wrap; }
    .scenario-switch button {
      border: 1px solid #2f5f79;
      background: #122b40;
      color: #eaf7ff;
      height: 32px;
      padding: 0 12px;
      line-height: 32px;
      border-radius: 10px;
      cursor: pointer;
      letter-spacing: 0.3px;
      font-weight: 750;
      transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    }
    .scenario-switch button.active {
      background: #1d3b52;
      color: #eaf7ff;
      border-color: #6ee0ca;
      transform: translateY(-2px);
      box-shadow: 0 10px 22px rgba(0,0,0,0.25);
    }
    .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
    .panel {
      background: var(--panel);
      border: 1px solid #1f3b59;
      border-radius: 16px;
      padding: 20px;
      box-shadow: 0 14px 32px rgba(0,0,0,0.32);
    }
    .panel h2 { margin: 0 0 10px; font-size: 18px; letter-spacing: 0.3px; }
    .hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
    table { width: 100%; border-collapse: collapse; color: var(--text); font-size: 14px; }
    th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
    th { color: var(--accent-strong); font-size: 13px; font-weight: 700; position: relative; }
    tbody tr:hover { background: #1a314a; }
    #guide-table tr.hover-sync { background: #1a314a; }

    footer.site-footer {
      margin-top: 22px;
      color: rgba(255,255,255,0.82);
      font-size: 12.5px;
      font-weight: 650;
      text-align: center;
      padding: 12px 0 18px;
      line-height: 1.8;
      background: rgba(10, 23, 40, 0.92);
      border-top: 1px solid rgba(255, 255, 255, 0.10);
    }
    footer.site-footer a {
      color: rgba(255,255,255,0.92);
      text-decoration: none;
      font-weight: 750;
    }
    footer.site-footer a:hover { text-decoration: underline; color: #fff; }

    /* テーブルヘッダ: 説明(?)ツールチップ */
    .th-content { display: inline-flex; align-items: center; gap: 6px; }
    .th-help-wrap { position: relative; display: inline-flex; align-items: center; }
    .th-help {
      width: 18px;
      height: 18px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.35);
      background: rgba(0,0,0,0.18);
      color: #eaf7ff;
      font-weight: 900;
      font-size: 12px;
      line-height: 18px;
      padding: 0;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .th-help:focus { outline: 2px solid rgba(110,224,202,0.7); outline-offset: 2px; }
    .th-tooltip {
      display: none;
      position: absolute;
      top: -8px;
      left: 50%;
      transform: translate(-50%, -100%);
      background: rgba(0,0,0,0.9);
      color: #fff;
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 10px;
      padding: 10px 12px;
      font-size: 12.5px;
      line-height: 1.35;
      width: max-content;
      max-width: 70vw;
      white-space: normal;
      word-break: break-word;
      box-shadow: 0 12px 26px rgba(0,0,0,0.45);
      z-index: 5000;
    }
    /* overflow の影響を受けずに表示するための固定ツールチップ（ヘッダ用） */
    #th-help-tooltip {
      display: none;
      position: fixed;
      background: rgba(0,0,0,0.92);
      color: #fff;
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 10px;
      padding: 10px 12px;
      font-size: 12.5px;
      line-height: 1.35;
      width: max-content;
      max-width: 70vw;
      white-space: normal;
      word-break: break-word;
      box-shadow: 0 12px 26px rgba(0,0,0,0.45);
      z-index: 6000;
      pointer-events: none;
    }
    #th-help-tooltip::after {
      content: "";
      position: absolute;
      width: 0;
      height: 0;
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
    }
    #th-help-tooltip.arrow-up::after {
      top: -6px;
      left: 50%;
      transform: translateX(-50%);
      border-bottom: 6px solid rgba(0,0,0,0.92);
    }
    #th-help-tooltip.arrow-down::after {
      bottom: -6px;
      left: 50%;
      transform: translateX(-50%);
      border-top: 6px solid rgba(0,0,0,0.92);
    }
    .th-tooltip::after {
      content: "";
      position: absolute;
      bottom: -6px;
      left: 50%;
      transform: translateX(-50%);
      width: 0;
      height: 0;
      border-left: 6px solid transparent;
      border-right: 6px solid transparent;
      border-top: 6px solid rgba(0,0,0,0.9);
    }
    .th-help:hover + .th-tooltip,
    .th-help:focus + .th-tooltip,
    .th-help.open + .th-tooltip { display: block; }

    /* Cell tooltip (e.g. keep-rate) */
    .cell-tip-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
    .cell-tip {
      display: none;
      position: fixed;
      background: rgba(0,0,0,0.85);
      border: 1px solid rgba(255,255,255,0.20);
      border-radius: 12px;
      padding: 10px 12px;
      z-index: 50;
      width: max-content;
      max-width: 340px;
      text-align: left;
      box-shadow: 0 16px 34px rgba(0,0,0,0.45);
      backdrop-filter: blur(2px);
      pointer-events: none;
    }
    .keep-with-title { color: #eaf7ff; font-weight: 800; margin-bottom: 6px; }
    .keep-with-list { display: grid; gap: 6px; }
    .keep-with-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .keep-with-card { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
    .keep-with-card .cost { width: 18px; height: 18px; border-radius: 6px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
    .keep-with-card .name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
    .keep-with-right { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; flex: 0 0 auto; }
    .keep-with-thumb { width: 88px; height: 22px; flex: 0 0 auto; overflow: hidden; }
    .keep-with-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,1) 46%, rgba(0,0,0,1) 100%);
      mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,1) 46%, rgba(0,0,0,1) 100%);
    }
    .keep-with-metric { font-size: 12px; color: #d4e7f6; white-space: nowrap; }

    /* マリガンガイド: 行を少し詰める */
    #guide-table th, #guide-table td { padding: 8px 6px; }
    #guide-table table { table-layout: fixed; }
    /* 単一テーブル表示（PC）と、分割表示（スマホ）のカード列幅 */
    #guide-table > table th:first-child,
    #guide-table > table td:first-child { width: 200px; }
    #guide-table .guide-left th:first-child,
    #guide-table .guide-left td:first-child { width: 200px; }
    /* ヘッダは読みやすさ優先、本文は行間を詰める */
    #guide-table th { padding-top: 8px; padding-bottom: 8px; }
    #guide-table td { padding-top: 0px; padding-bottom: 0px; }
    #guide-table th:not(:first-child), #guide-table td:not(:first-child) { text-align: center; }
    #guide-table th { white-space: nowrap; }
    /* ヘッダの「カード」だけ中央寄せ（本文のカード列は左寄せのまま） */
    #guide-table .guide-table thead th:first-child { text-align: center; }
    #guide-table th:first-child,
    #guide-table td:first-child { width: 200px; }
    #guide-table .guide-grid { overflow-x: auto; overflow-y: visible; border: 1px solid #1f3b59; border-radius: 12px; }
    #guide-table .guide-table { width: 100%; border-collapse: collapse; }
    #guide-table .guide-table thead th { position: sticky; top: 0; background: #152c42; z-index: 1; }
    #guide-table .guide-table th:first-child,
    #guide-table .guide-table td:first-child { position: sticky; left: 0; background: #152c42; z-index: 2; text-align: left; }
    #guide-table .card-cell { gap: 8px; min-height: 32px; position: relative; }
    #guide-table .card-cell .cost {
      width: 20px;
      height: 20px;
      border-radius: 7px;
      font-size: 12px;
      text-shadow:
        -0.7px 0 0 rgba(0,0,0,0.9),
        0.7px 0 0 rgba(0,0,0,0.9),
        0 -0.7px 0 rgba(0,0,0,0.9),
        0 0.7px 0 rgba(0,0,0,0.9);
      -webkit-text-stroke: 0px transparent;
    }
    #guide-table .card-cell .cost.r4 {
      text-shadow:
        -0.55px 0 0 rgba(255,255,255,0.98),
        0.55px 0 0 rgba(255,255,255,0.98),
        0 -0.55px 0 rgba(255,255,255,0.98),
        0 0.55px 0 rgba(255,255,255,0.98);
      -webkit-text-stroke: 0px transparent;
    }
    #guide-table .card-cell .name {
      max-width: 120px;
      font-size: 13px;
      /* 外側だけ太く見せる（text-stroke は内側にも食い込みやすいので使わない） */
      -webkit-text-stroke: 0px transparent;
      text-shadow:
        0 1px 2px rgba(0,0,0,0.55),
        -1px 0 0 rgba(0,0,0,0.78),
        1px 0 0 rgba(0,0,0,0.78),
        0 -1px 0 rgba(0,0,0,0.78),
        0 1px 0 rgba(0,0,0,0.78),
        -1px -1px 0 rgba(0,0,0,0.72),
        1px -1px 0 rgba(0,0,0,0.72),
        -1px 1px 0 rgba(0,0,0,0.72),
        1px 1px 0 rgba(0,0,0,0.72);
    }
    #guide-table .card-cell .card-thumb {
      width: 110px;
      height: 32px;
      border-radius: 0;
      position: absolute;
      right: 0;
      top: 50%;
      transform: translateY(-50%);
      box-shadow: none;
      background: transparent;
    }
    #guide-table .card-cell .card-thumb img {
      -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.10) 3%, rgba(0,0,0,0.30) 6%, rgba(0,0,0,0.65) 9%, rgba(0,0,0,0.90) 12%, #000 16%, #000 100%);
      mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.10) 3%, rgba(0,0,0,0.30) 6%, rgba(0,0,0,0.65) 9%, rgba(0,0,0,0.90) 12%, #000 16%, #000 100%);
    }
    .tag { background: var(--card); color: var(--accent-strong); padding: 2px 8px; border-radius: 12px; font-size: 12px; display: inline-block; }
    .error { color: #f49; margin-top: 10px; }
    .class-filter { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; align-items: center; margin: 2px 0; min-height: 52px; }
    .class-filter .label {
      color: #d4e7f6;
      font-size: 14px;
      letter-spacing: 0.25px;
      justify-self: center;
      align-self: center;
      text-align: center;
      font-weight: 750;
      padding: 0 10px;
      min-width: 86px;
      height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #2f5f79;
      border-radius: 12px;
      background: rgba(255,255,255,0.04);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    }
    .filter-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .class-filter button {
      border: 1px solid #2f5f79;
      background: #122b40;
      color: #eaf7ff;
      height: 32px;
      padding: 0 10px;
      border-radius: 12px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      box-shadow: 0 6px 16px rgba(0,0,0,0.22);
      transition: background 0.15s, transform 0.15s, border-color 0.15s, box-shadow 0.15s;
      font-weight: 750;
    }
    .class-filter button.active { background: #1d3b52; border-color: #6ee0ca; color: #eaf7ff; transform: translateY(-2px); box-shadow: 0 10px 18px rgba(0,0,0,0.28); }
    .class-filter button.dim { opacity: 0.6; }
    .class-filter button.dim img { filter: grayscale(0.5) brightness(0.65); opacity: 0.8; }
    .class-filter img { width: 22px; height: 22px; object-fit: contain; border-radius: 8px; padding: 0; }
    .class-filter .text { display: none; }
    .class-filter button.all-btn { height: 32px; padding: 0 12px; gap: 6px; }
    .class-filter button.all-btn .text { display: inline-block; }
    .archetype-filter .text { display: inline-block; }
    .archetype-filter .filter-buttons { flex-wrap: wrap; }
    .slot-opp-archetype {
      position: relative;
      height: 0;
      padding: 0;
      margin: 0;
      overflow: hidden;
      transition: height 0.28s ease, padding 0.28s ease, margin 0.28s ease;
    }
    .slot-my-archetype {
      position: relative;
      height: auto;
      padding: 2px 0;
      margin: 2px 0;
      overflow: visible;
      transition: none;
    }
    .slot-opp-archetype .class-filter.collapsible {
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      max-height: none;
      margin: 0;
      padding: 0;
      min-height: 52px;
      opacity: 0;
      pointer-events: none;
      transform: translateY(-6px);
      transition: opacity 0.22s ease, transform 0.22s ease;
    }
    .slot-opp-archetype .class-filter.collapsible.visible {
      margin: 0;
      padding: 0;
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }
    .slot-my-archetype .class-filter.collapsible {
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      max-height: none;
      margin: 0;
      padding: 0;
      min-height: 52px;
      opacity: 0;
      pointer-events: none;
      transform: translateY(-6px);
      transition: opacity 0.22s ease, transform 0.22s ease;
    }
    .slot-my-archetype .class-filter.collapsible.visible {
      margin: 0;
      padding: 0;
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }
    .scenario-wrap { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; align-items: center; margin: 2px 0 8px; min-height: 52px; }
    .scenario-wrap .label {
      color: #d4e7f6;
      font-size: 14px;
      letter-spacing: 0.25px;
      justify-self: center;
      align-self: center;
      text-align: center;
      font-weight: 750;
      padding: 6px 10px;
      min-width: 86px;
      border: 1px solid #2f5f79;
      border-radius: 12px;
      background: rgba(255,255,255,0.04);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    }
    .scenario-switch { margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
    .cr-input {
      width: 52px;
      min-width: 52px;
      height: 32px;
      line-height: 32px;
      padding: 0 8px;
      border-radius: 10px;
      border: 1px solid #2f5f79;
      background: #0f2235;
      color: #eaf7ff;
      text-align: center;
      font-variant-numeric: tabular-nums;
      appearance: textfield;
      -moz-appearance: textfield;
    }
    .filter-select {
      height: 32px;
      min-width: 180px;
      padding: 0 10px;
      border-radius: 10px;
      border: 1px solid #2f5f79;
      background: #0f2235;
      color: #eaf7ff;
      font-weight: 750;
      letter-spacing: 0.2px;
      appearance: none;
    }
    .cr-input::-webkit-outer-spin-button,
    .cr-input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    .tabs { display: flex; gap: 12px; margin: 12px 0 12px; flex-wrap: wrap; }
    .tabs button {
      border: 1px solid #2f5f79;
      background: #122b40;
      color: #eaf7ff;
      padding: 12px 16px;
      border-radius: 12px;
      cursor: pointer;
      letter-spacing: 0.3px;
      font-weight: 750;
      transition: background 0.15s, transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    }
    .tabs button.active {
      background: #1d3b52;
      color: #eaf7ff;
      border-color: #6ee0ca;
      transform: translateY(-2px);
      box-shadow: 0 10px 22px rgba(0,0,0,0.28);
    }
    .panels { margin-top: 4px; }
    .panel.hidden { display: none; }
    .card-cell { display: flex; align-items: center; gap: 10px; min-height: 44px; line-height: 1.15; }
    .card-cell .cost { width: 24px; height: 24px; border-radius: 8px; background: transparent; color: #ffffff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); flex-shrink: 0; border: 1px solid rgba(0,0,0,0.35); }
    .card-cell .cost.r1 { background: #5a4a33; }
    .card-cell .cost.r2 { background: #7087a7; }
    .card-cell .cost.r3 { background: #b08c2d; }
    .card-cell .cost.r4 { background: linear-gradient(135deg, #ffd6ff 0%, #b5d8ff 35%, #d5ffea 70%, #ffd6ff 100%); color: #1b1d2a; }
    .card-cell .name { position: relative; z-index: 1; font-weight: 600; letter-spacing: 0.2px; flex: 1; min-width: 0; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .card-cell .card-thumb {
      margin-left: auto;
      width: 150px;
      height: 44px;
      border-radius: 10px;
      pointer-events: none;
      background: #0b1826;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
      overflow: hidden;
      display: block;
      position: relative;
    }
    .card-cell .card-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .card-cell .card-thumb.crop img {
      /* --crop-* は「画像全体に対する」0..1 正規化 */
      width: calc(100% / var(--crop-w));
      height: calc(100% / var(--crop-h));
      object-fit: fill;
      transform-origin: top left;
      transform:
        translate(
          calc(var(--crop-x) * (-100% / var(--crop-w))),
          calc(var(--crop-y) * (-100% / var(--crop-h)))
        );
    }
    .panel-meta { text-align: right; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
    .sortable { cursor: pointer; }
    .sortable::after { content: "⇅"; font-size: 11px; margin-left: 4px; color: var(--muted); }
    .sortable.active.asc::after { content: "▲"; color: var(--accent-strong); }
    .sortable.active.desc::after { content: "▼"; color: var(--accent-strong); }
    .detail-toggle { margin: 12px 0; }
    .detail-toggle button {
      border: 1px solid #2f5f79;
      background: #122b40;
      color: #eaf7ff;
      padding: 10px 16px;
      border-radius: 12px;
      cursor: pointer;
      font-weight: 750;
      letter-spacing: 0.3px;
      box-shadow: 0 8px 18px rgba(0,0,0,0.28);
    }
    .detail-panel {
      margin: 0;
      padding: 0;
      border: 1px solid #1f3b59;
      border-radius: 14px;
      background: rgba(17,37,56,0.75);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      transition: max-height 0.35s ease, opacity 0.35s ease, padding 0.35s ease, margin 0.35s ease;
    }
    .detail-panel.visible {
      margin: 6px 0 14px;
      padding: 14px 12px;
      max-height: 800px;
      opacity: 1;
    }
    .class-filter.collapsible {
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      padding: 0;
      margin: 0;
      min-height: 0;
      visibility: hidden;
      pointer-events: none;
      transition: max-height 0.35s ease, opacity 0.35s ease, padding 0.35s ease, margin 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
      transform: translateY(-6px);
    }
    .class-filter.collapsible.visible {
      max-height: 240px;
      opacity: 1;
      padding: 6px 0;
      margin: 4px 0;
      min-height: 52px;
      visibility: visible;
      pointer-events: auto;
      transform: translateY(0);
    }
    .slot-cr-group {
      position: relative;
      height: 0;
      padding: 0;
      margin: 0;
      overflow: hidden;
      transition: height 0.28s ease, padding 0.28s ease, margin 0.28s ease;
    }
    .slot-cr-group .class-filter.collapsible {
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      margin: 0;
      opacity: 0;
      pointer-events: none;
      transform: translateY(-6px);
      transition: opacity 0.22s ease, transform 0.22s ease;
    }
    .slot-cr-group .class-filter.collapsible.visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }
    .matchup-filters {
      margin: 6px 0 10px;
      padding: 0;
      border: none;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }
    /* マリガンガイドの検索条件行だけ位置が上に見えるため、他と同じ余白に揃える */
    #guide-filters {
      margin: 14px 0 10px;
      padding: 0;
    }
    .hidden-block { display: none !important; }
    .matchup-grid { overflow: auto; border: 1px solid #1f3b59; border-radius: 12px; max-height: min(72vh, 680px); }
    .matchup-table { width: 100%; border-collapse: collapse; min-width: 720px; }
    .matchup-table th,
    .matchup-table td { padding: 10px 8px; border-bottom: 1px solid #1f3b59; border-right: 1px solid #1f3b59; text-align: center; }
    .matchup-table th:last-child,
    .matchup-table td:last-child { border-right: none; }
    .matchup-table thead th { position: sticky; top: 0; background: #152c42; z-index: 1; }
    .matchup-table .row-head { position: sticky; left: 0; background: #152c42; text-align: left; z-index: 2; }
    .matchup-table .row-head.center { text-align: center; }
    .class-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: 0.2px; }
    .class-chip img { width: 24px; height: 24px; object-fit: contain; border-radius: 8px; }
    .class-chip .chip-text { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
    .matchup-table.matchup-archetype th,
    .matchup-table.matchup-archetype td { padding: 8px 6px; font-size: 12px; }
    .cell-winrate { position: relative; border-radius: 10px; overflow: hidden; background: #0f2235; color: #eaf7ff; font-weight: 700; }
    .cell-winrate .bar {
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, rgba(70,194,173,0.32), rgba(70,194,173,0.08));
      transform-origin: left;
      pointer-events: none;
    }
    .cell-winrate .content { position: relative; padding: 10px 6px; display: grid; gap: 6px; }
    .cell-winrate .meta { font-size: 12px; color: #9fb5c7; }
    .cell-empty { color: #5f7991; font-size: 12px; }

    .tier-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      align-items: start;
    }
    .tier-col {
      border: 1px solid #1f3b59;
      border-radius: 14px;
      background: rgba(17,37,56,0.72);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
      overflow: hidden;
    }
    .tier-col .head {
      padding: 10px 12px;
      background: linear-gradient(90deg, rgba(48,122,164,0.26) 0%, rgba(21,44,66,0.95) 55%);
      border-bottom: 1px solid #2a5779;
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: baseline;
      font-weight: 900;
      font-size: 22px;
      letter-spacing: 0.3px;
      text-shadow: 0 2px 10px rgba(0,0,0,0.35);
      box-shadow: inset 4px 0 0 rgba(70,194,173,0.45);
    }
    .tier-col .head .count { color: #9fb5c7; font-weight: 800; font-size: 12px; }
    /* 各Tierの中は「3列固定（余りは空列）」 */
    .tier-col .body {
      --tier-card-width: 299px;
      padding: 10px 10px 12px;
      display: grid;
      grid-template-columns: repeat(3, var(--tier-card-width));
      gap: 10px;
      align-items: stretch;
      justify-content: start; /* 余白は右側に逃がす（パネル幅を維持） */
    }
    .tier-item {
      /* 画像側の固定幅（score を画像左端に揃える基準） */
      --tier-bg-width: 150px;
      position: relative;
      overflow: hidden;
      display: grid;
      grid-template-columns: 1fr;
      gap: 2px;
      /* 上側が欠けやすいので top を少し確保 */
      padding: 7px 10px 5px;
      border-radius: 12px;
      border: 1px solid rgba(31,59,89,0.9);
      background: rgba(11,24,38,0.65);
      height: 60px;
      /* 2列/1列になってもパネル幅を固定（伸びない） */
      width: var(--tier-card-width);
      max-width: 100%;
    }
    /* Tierパネル: リンクに見せる（遷移先は後で実装予定） */
    .tier-item.linkable {
      cursor: pointer;
      transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
      will-change: transform;
    }
    .tier-item.linkable:hover {
      transform: translateY(-2px) scale(1.012);
      border-color: rgba(110,224,202,0.55);
      box-shadow: 0 16px 30px rgba(0,0,0,0.28);
      background: rgba(11,24,38,0.72);
    }
    .tier-item.linkable:focus-visible {
      outline: 2px solid rgba(110,224,202,0.75);
      outline-offset: 2px;
      transform: translateY(-2px) scale(1.012);
    }
    .tier-link-icon {
      position: absolute;
      top: 7px;
      right: 8px;
      z-index: 3;
      font-size: 14px;
      font-weight: 900;
      letter-spacing: 0.2px;
      color: rgba(234,247,255,0.92);
      opacity: 0;
      transform: translateY(2px);
      transition: opacity 0.16s ease, transform 0.16s ease;
      pointer-events: none;
      text-shadow: 0 1px 6px rgba(0,0,0,0.55);
    }
    .tier-item.linkable:hover .tier-link-icon,
    .tier-item.linkable:focus-visible .tier-link-icon {
      opacity: 1;
      transform: translateY(0);
    }
    .tier-item .content {
      position: relative;
      z-index: 2;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 6px;
    }
    .tier-row1 {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      column-gap: 12px;
      padding-top: 2px; /* 日本語グリフの上側が切れるのを防ぐ */
      /* % は画像に被せてOK（文字同士の衝突を避けるため、row1 を画像側へ少し伸ばす） */
      width: calc(100% - var(--tier-bg-width) + 40px);
    }
    .tier-row1 .title {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex: 1 1 auto;
      overflow: hidden;
      padding-right: 6px; /* score の領域と文字が被らないように余白 */
    }
    .tier-row1 .class-chip { font-size: 22px; line-height: 1.15; }
    .tier-row1 .tier-score {
      justify-self: end;
      font-weight: 900;
      /* アーキタイプ名と同等のインパクト */
      font-size: 22px;
      line-height: 1.15; /* 上側が切れるケース対策 */
      letter-spacing: 0.2px;
      color: #eaf7ff;
      white-space: nowrap;
      text-shadow: 0 1px 0 rgba(0,0,0,0.35);
      flex: 0 0 auto;
    }
    .tier-row2 {
      color: #9fb5c7;
      font-size: 12px;
      white-space: nowrap;
      /* 2段目は省略せず、必要なら画像に被せてOK */
      width: 100%;
    }
    .tier-symbol-bg {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      width: var(--tier-bg-width);
      z-index: 1;
      pointer-events: none;
      overflow: hidden;
    }
    .tier-symbol-bg img {
      position: absolute;
      right: 0;
      top: 0;
      height: 100%;
      /* 高さ基準で常にパネル高に一致（サムネの縦横比がバラバラでも高さは揃う） */
      width: auto;
      max-width: none;
      object-position: right center;
      display: block;
      opacity: 0.95;
      transform: translateZ(0);
      /* マリガンガイドと同じ: 画像の左端を透過グラデでフェード */
      -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.10) 3%, rgba(0,0,0,0.30) 6%, rgba(0,0,0,0.65) 9%, rgba(0,0,0,0.90) 12%, #000 16%, #000 100%);
      mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.10) 3%, rgba(0,0,0,0.30) 6%, rgba(0,0,0,0.65) 9%, rgba(0,0,0,0.90) 12%, #000 16%, #000 100%);
    }
    /* 追加の色味調整（薄く被せる程度） */
    .tier-symbol-bg::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(90deg, rgba(11,24,38,0.90) 0%, rgba(11,24,38,0.55) 55%, rgba(11,24,38,0.0) 100%);
      opacity: 0.55;
    }
    .tier-symbol-thumb {
      width: 44px;
      height: 44px;
      border-radius: 10px;
      overflow: hidden;
      background: #0b1826;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
      flex: 0 0 auto;
    }
    .tier-symbol-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    /* 旧実装の残骸（Tierカードは tier-row1 / tier-row2 を使用） */
    .tier-note { margin: 10px 0 0; color: #9fb5c7; font-size: 12px; line-height: 1.5; }
    .tier-ref {
      margin-top: 14px;
      border: 1px dashed rgba(31,59,89,0.9);
      border-radius: 14px;
      padding: 12px;
      background: rgba(11,24,38,0.35);
    }
    .tier-ref .title { font-weight: 900; letter-spacing: 0.2px; margin-bottom: 8px; }
    .tier-ref .list { display: flex; flex-wrap: wrap; gap: 8px; }
    .tier-ref .pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 999px;
      border: 1px solid rgba(31,59,89,0.9);
      background: rgba(11,24,38,0.65);
      font-size: 12px;
      color: #d8ebf7;
    }
    @media (max-width: 1100px) {
      /* 文字が詰まりやすいので、2列に落とすタイミングを早める */
      .tier-col .body { grid-template-columns: repeat(2, var(--tier-card-width)); }
    }
    @media (max-width: 740px) {
      .tier-col .body { grid-template-columns: 1fr; }
      .tier-item { --tier-bg-width: 140px; }
    }
  @media (max-width: 768px) {
      body { font-size: 15px; }
      .page { padding: 18px 14px 60px; }
      header h1 { font-size: 27px; }
      header .meta { font-size: 13px; }
      .class-filter, .scenario-wrap {
        grid-template-columns: 1fr;
        align-items: flex-start;
        min-height: unset;
      }
    .class-filter .label,
    .scenario-wrap .label {
      justify-self: start;
      margin-bottom: 4px;
    }
      .filter-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 6px;
      }
      .scenario-switch {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 6px;
      }
  .filter-buttons button,
  .scenario-switch button {
    width: 100%;
    justify-content: center;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 12px;
    font-size: 13px;
  }
  .class-filter img { width: 28px; height: 28px; }
  th, td { padding: 8px 6px; font-size: 13px; }
  .card-cell { gap: 8px; min-height: 40px; }
  .card-cell .card-thumb { width: 120px; height: 38px; }
  #guide-table .guide-grid { -webkit-overflow-scrolling: touch; }
  #guide-table .guide-table { min-width: 720px; }
  .grid { grid-template-columns: 1fr; }
}

    /* CRプリセット（共通） */
    .cr-presets { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
    .cr-presets button {
      border: 1px solid #2f5f79;
      background: #122b40;
      color: #eaf7ff;
      padding: 4px 10px;
      border-radius: 12px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      height: 32px; /* 他ボタンと高さを揃える */
      min-width: 80px;
      flex-shrink: 0;
      gap: 6px;
      box-shadow: 0 6px 16px rgba(0,0,0,0.22);
      transition: background 0.15s, transform 0.15s, border-color 0.15s, box-shadow 0.15s;
      font-weight: 750;
    }
 .cr-presets button.active {
   background: #1d3b52;
   border-color: #6ee0ca;
   transform: none;
   box-shadow: 0 8px 16px rgba(0,0,0,0.24);
 }
 .cr-presets button.dim { opacity: 0.6; }
   .cr-presets img {
     width: 100%;
     height: 100%;
     object-fit: contain;
     display: block;
     max-width: 60px;
     max-height: 20px;
   }
    /* CR行は入力とプリセットを横並びのフレックスで配置 */
     #cr-filter .filter-buttons,
     #cr-filter-match .filter-buttons,
     #cr-filter-tier .filter-buttons {
       display: flex !important;
       flex-wrap: wrap;
       align-items: center;
       gap: 16px;
     }
 /* CR行だけはグリッドでなくフレックス配置にする（IDで上書き） */
     #cr-filter .filter-buttons,
     #cr-filter-match .filter-buttons,
     #cr-filter-tier .filter-buttons {
       display: flex !important;
       flex-wrap: nowrap;
       align-items: center;
       gap: 18px;
       overflow-x: auto;
    /* スマホは「カード列固定 + 右側だけ横スクロール」 */
    #guide-table .guide-clip { border-radius: 14px; overflow: hidden; }
    #guide-table .guide-split { display: flex; width: 100%; }
    #guide-table .guide-left { flex: 0 0 auto; }
    #guide-table .guide-right {
      flex: 1 1 auto;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
    }
    #guide-table .guide-right table { min-width: 480px; }
    #guide-table .guide-left table { width: 200px; }
  }

    /* ここから下は「白基調」テーマの上書き（既存CSSを崩しにくくするため） */
    body { background: var(--bg); color: var(--text); }
    .page { padding-top: 18px; }
    .panel {
      background: var(--panel) !important;
      border: 1px solid var(--line) !important;
      box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06) !important;
    }
    header h1 { color: var(--text) !important; text-shadow: none !important; }
    .hint { color: var(--muted) !important; }
    table { color: var(--text) !important; }
    th { color: var(--accent) !important; }
    th, td { border-bottom: 1px solid var(--line) !important; }
    tbody tr:hover { background: #F6F8FB !important; }

    .filter-actions button,
    .scenario-switch button,
    .tabs button {
      border: 1px solid var(--line) !important;
      background: #fff !important;
      color: var(--text) !important;
      box-shadow: none !important;
    }
    .filter-actions button:hover,
    .scenario-switch button:hover,
    .tabs button:hover {
      background: #F6F8FB !important;
    }
    .scenario-switch button.active,
    .tabs button.active {
      border-color: rgba(37, 99, 235, 0.55) !important;
      background: rgba(37, 99, 235, 0.10) !important;
      color: var(--text) !important;
      transform: translateY(-1px) !important;
    }

    .filter-select,
    input[type="number"],
    input[type="text"] {
      border: 1px solid var(--line) !important;
      background-color: #fff !important;
      color: var(--text) !important;
    }

    .error { color: #C2410C !important; }

    /* 本文側のリンク（ヘッダは別スタイル） */
    .page a { color: var(--accent) !important; }
    .page a:visited { color: var(--accent) !important; }
    .page a.btn { color: inherit !important; text-decoration: none !important; }

    /* 本文の文字影を全撤去（見づらさ対策） */
    .page * { text-shadow: none !important; }

    /* 詳細検索ボタン（ゴースト） */
    .detail-toggle { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    .detail-toggle button {
      border: 1px solid var(--line) !important;
      background: transparent !important;
      color: var(--muted) !important;
      box-shadow: none !important;
      white-space: nowrap;
    }
    .detail-toggle button:hover { background: #F6F8FB !important; color: var(--text) !important; }
    /* リセットはゴーストボタン（主張を抑える） */
    button[id^="reset-"] {
      border-color: var(--line) !important;
      background: transparent !important;
      color: var(--muted) !important;
      box-shadow: none !important;
    }
    button[id^="reset-"]:hover { background: #F6F8FB !important; color: var(--text) !important; }

    /* Tier表メタ: テキスト表示（チップ化はしない） */
    .panel-meta .meta-pill { display: none !important; }

    /* ラベル（見やすく） */
    .label {
      color: #334155 !important;
      font-weight: 850 !important;
      letter-spacing: 0.2px;
    }
    /* 抽出条件ラベルは「枠あり」だと密度が上がるので、枠線/背景を消して文字だけにする */
    .class-filter .label,
    .scenario-wrap .label {
      border: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
      height: auto !important;
      min-width: 0 !important;
      padding: 0 !important;
      justify-self: start !important;
      text-align: left !important;
      color: #374151 !important;
      font-size: 14px !important;
    }
    /* ラベルと入力欄を少し詰める */
    .class-filter {
      grid-template-columns: 92px 1fr !important;
      gap: 4px 10px !important;
      min-height: 44px !important;
    }
    /* 「シーズン」「Tier基準」だけは中央寄せの方が見た目が締まりやすい */
    .class-filter .label.label-center,
    .scenario-wrap .label.label-center {
      justify-self: center !important;
      text-align: center !important;
    }
    /* 詳細検索内のラベルは中央寄せ */
    .detail-panel .class-filter .label,
    .detail-panel .scenario-wrap .label {
      justify-self: center !important;
      text-align: center !important;
    }
    .detail-panel .detail-actions {
      display: flex;
      justify-content: flex-start;
      margin-top: 12px;
      /* 入力欄の列に揃える（ラベル列: 92px + gap: 10px） */
      padding-left: 102px;
    }
    .detail-panel .detail-actions button {
      height: 34px !important;
      padding: 0 12px !important;
      border-radius: 12px !important;
      border: 1px solid var(--line) !important;
      background: transparent !important;
      color: var(--muted) !important;
      box-shadow: none !important;
      font-weight: 750 !important;
      letter-spacing: 0.2px;
      cursor: pointer;
    }
    .detail-panel .detail-actions button:hover {
      background: #F6F8FB !important;
      color: var(--text) !important;
    }

    /* Tier表: シーズン + Tier基準 を1行に（PC） */
    #tier-filters .tier-top-row {
      display: grid;
      grid-template-columns: auto auto 1fr auto;
      gap: 24px;
      align-items: center;
      margin: 2px 0 8px;
    }
    #tier-filters .tier-top-row > * { margin: 0 !important; }
    #tier-filters .tier-top-row .scenario-wrap {
      display: grid;
      grid-template-columns: 110px auto;
      align-items: center;
      gap: 6px 12px;
      margin: 0 !important;
    }
    #tier-filters .tier-top-row .scenario-switch { margin: 0 !important; }
    #tier-filters .tier-top-row .tier-top-actions { justify-self: end; }
    #tier-filters .tier-top-row .tier-top-actions.detail-toggle { margin: 0 !important; }
    @media (max-width: 900px) {
      #tier-filters .tier-top-row { grid-template-columns: 1fr; }
      #tier-filters .tier-top-row .tier-top-actions { justify-self: start; }
    }

    /* マッチアップ: シーズン + 表示 を1行に（PC） */
    #matchup-filters .match-top-row {
      display: grid;
      grid-template-columns: auto auto 1fr auto;
      gap: 24px;
      align-items: center;
      margin: 2px 0 8px;
    }
    #matchup-filters .match-top-row > * { margin: 0 !important; }
    #matchup-filters .match-top-row .scenario-wrap {
      display: grid;
      grid-template-columns: 72px auto;
      align-items: center;
      gap: 4px 8px;
      margin: 0 !important;
    }
    #matchup-filters .match-top-row .match-top-actions { justify-self: end; }
    #matchup-filters .match-top-row .match-top-actions.detail-toggle { margin: 0 !important; }
    @media (max-width: 900px) {
      #matchup-filters .match-top-row { grid-template-columns: 1fr; }
      #matchup-filters .match-top-row .match-top-actions { justify-self: start; }
    }

    /* マリガンガイド: 条件 + 詳細検索を1行に（PC） */
    #guide-filters .guide-top-row {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 16px;
      align-items: center;
      margin: 2px 0 8px;
    }
    #guide-filters .guide-top-row > * { margin: 0 !important; }
    #guide-filters .guide-top-row .detail-toggle { margin: 0 !important; }
    #guide-filters .guide-top-row .guide-top-actions { justify-self: end; }
    #guide-filters .guide-top-row .guide-top-actions.detail-toggle { margin: 0 !important; }
    @media (max-width: 900px) {
      #guide-filters .guide-top-row { grid-template-columns: 1fr; }
      #guide-filters .guide-top-row .guide-top-actions { justify-self: start; }
    }

    /* マリガンガイド: 2行目にクラス/アーキタイプを1行で */
    #guide-filters .guide-sub-row {
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: nowrap;
      margin: 0 0 8px;
      overflow: visible;
    }
    #guide-filters .guide-sub-row > * { margin: 0 !important; }
    #guide-filters .guide-sub-row .slot-my-archetype { flex: 1; min-width: 0; }

    /* マリガンガイド: クラス/アーキタイプはアイコン選択（1行に収める） */
    #guide-filters #class-filter .filter-buttons,
    #guide-filters #my-archetype-filter .filter-buttons {
      flex-wrap: nowrap !important;
      overflow-x: auto;
      overflow-y: visible;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
      max-width: 100%;
      padding-top: 2px;
      padding-bottom: 2px;
    }
    #guide-filters #class-filter button,
    #guide-filters #my-archetype-filter button {
      flex: 0 0 auto;
    }
    #guide-filters #my-archetype-filter button img {
      width: 22px;
      height: 22px;
      border-radius: 8px;
      object-fit: cover;
    }

    /* マリガンガイド: クラスのラベルは中央寄せ */
    #guide-filters #class-filter .label {
      justify-self: center !important;
      text-align: center !important;
    }

    /* マリガンガイド: シーズンselectの開始位置とクラス先頭アイコンの開始位置を揃える */
    #guide-filters #class-filter .filter-buttons {
      padding-left: 0 !important;
      margin-left: 0 !important;
    }

    /* select をリストっぽく（▼） */
    select.filter-select {
      appearance: none;
      -webkit-appearance: none;
      padding-right: 34px !important;
      background-color: #fff !important;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%234B5565' d='M4.2 6.2a1 1 0 0 1 1.4 0L8 8.6l2.4-2.4a1 1 0 1 1 1.4 1.4l-3.1 3.1a1 1 0 0 1-1.4 0L4.2 7.6a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      background-size: 16px 16px;
    }

    /* アイコン付きselect */
    .select-with-icon {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      position: relative;
    }
    .select-with-icon img {
      width: 22px;
      height: 22px;
      object-fit: contain;
      border-radius: 8px;
      flex: 0 0 auto;
      opacity: 0.92;
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      pointer-events: none;
    }
    .select-with-icon select.filter-select {
      min-width: 0;
      padding-left: 44px !important;
      width: 160px;
      max-width: 160px;
    }

    /* アイコン付きドロップダウン（optionに画像を出せないため自前実装） */
    .icon-select {
      position: relative;
      display: inline-block;
      min-width: 0;
    }
    .icon-select-btn {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      width: 160px;
      max-width: 100%;
      height: 40px !important;
      padding: 0 34px 0 44px !important; /* 左アイコン + 右▼ */
      border-radius: 14px !important;
      border: 1px solid var(--line) !important;
      background: #fff !important;
      color: var(--text) !important;
      cursor: pointer;
      font-weight: 800;
      white-space: nowrap;
      text-align: left;
      box-shadow: none !important;
      transform: none !important;
    }
    .icon-select-btn::after {
      content: "";
      position: absolute;
      right: 12px;
      top: 50%;
      width: 16px;
      height: 16px;
      transform: translateY(-50%);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%234B5565' d='M4.2 6.2a1 1 0 0 1 1.4 0L8 8.6l2.4-2.4a1 1 0 1 1 1.4 1.4l-3.1 3.1a1 1 0 0 1-1.4 0L4.2 7.6a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-size: 16px 16px;
      opacity: 0.9;
      pointer-events: none;
    }
    .icon-select-btn img {
      position: absolute;
      left: 12px;
      top: 50%;
      width: 22px;
      height: 22px;
      transform: translateY(-50%);
      object-fit: contain;
      border-radius: 8px;
      pointer-events: none;
      opacity: 0.92;
    }
    .icon-select-btn .btn-text {
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .icon-select-list {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      width: 100%;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: 0 14px 30px rgba(17, 24, 39, 0.14);
      padding: 6px;
      z-index: 1000;
      display: none;
      max-height: 260px;
      overflow: auto;
    }
    .icon-select.open .icon-select-list { display: block; }
    .icon-select-item {
      width: 100%;
      border: 0 !important;
      background: transparent !important;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 10px !important;
      border-radius: 10px !important;
      cursor: pointer;
      color: var(--text) !important;
      font-weight: 800;
      text-align: left;
      white-space: nowrap;
      height: auto !important;
      box-shadow: none !important;
      transform: none !important;
    }
    .icon-select-item:hover { background: #F6F8FB; }
    .icon-select-item.active { background: rgba(37, 99, 235, 0.10) !important; }
    .icon-select-item img {
      width: 20px;
      height: 20px;
      object-fit: contain;
      border-radius: 8px;
      opacity: 0.92;
      flex: 0 0 auto;
    }

    /* マリガンガイド: ラベルと入力の隙間をさらに詰める */
    #guide-filters #class-filter,
    #guide-filters #my-archetype-filter {
      gap: 4px 6px !important;
    }

    /* クラス/アーキタイプ等のボタン群 */
    .class-filter button {
      border: 1px solid var(--line) !important;
      background: #fff !important;
      color: var(--text) !important;
      box-shadow: none !important;
      transform: none !important;
    }
    .class-filter button:hover { background: #F6F8FB !important; }
    .class-filter button.active {
      border-color: rgba(37, 99, 235, 0.55) !important;
      background: rgba(37, 99, 235, 0.10) !important;
      color: var(--text) !important;
      box-shadow: none !important;
      transform: translateY(-1px) !important;
    }

    /* 詳細検索パネル */
    .detail-panel {
      background: #fff !important;
      border: 1px solid var(--line) !important;
      box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06) !important;
    }

    /* Tier表（濃い背景を白基調に上書き） */
    .tier-col {
      /* Tier枠（箱感）はなくして、見出し行＋左バーだけを残す */
      background: transparent !important;
      border: 0 !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      /* 子要素（カード）の影が切れないようにする */
      overflow: visible !important;
    }
    .tier-col .head {
      background: #F6F8FB !important;
      border-bottom: 1px solid var(--line) !important;
      color: var(--text) !important;
      position: relative !important;
      padding-left: 18px !important;
      /* 見出しを少しコンパクトに */
      padding-top: 8px !important;
      padding-bottom: 8px !important;
      font-size: 20px !important;
      align-items: center !important;
      justify-content: flex-start !important;
      gap: 10px !important;
      border-radius: 0 !important;
    }
    .tier-col .head { text-shadow: none !important; }
    .tier-col .head::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 6px;
      background: var(--tier-bar, var(--accent));
      border-radius: 0 !important;
    }
    .tier-grid > .tier-col:nth-child(1) { --tier-bar: #2563EB; }
    .tier-grid > .tier-col:nth-child(2) { --tier-bar: #22C55E; }
    .tier-grid > .tier-col:nth-child(3) { --tier-bar: #F59E0B; }
    .tier-grid > .tier-col:nth-child(4) { --tier-bar: #A855F7; }

    /* Tier間の区切り（縦に並ぶ想定） */
    .tier-grid { gap: 16px !important; }
    .tier-col .head .count { color: var(--muted) !important; }
    .tier-col .body {
      background: transparent !important;
      padding: 12px 12px 14px !important;
      gap: 12px !important;
    }

    .tier-item {
      /* 白背景カードに戻し、文字が画像に被る部分は「白の半透明帯」で読みやすくする */
      background: #fff !important;
      /* 入れ子感が出るので、カード枠は消して影だけにする */
      border: 1px solid rgba(230, 234, 240, 0.95) !important;
      box-shadow: 0 10px 22px rgba(17, 24, 39, 0.06) !important;
      color: var(--text) !important;
    }
    /* クラス色の線：通常は薄く、hover/focusで少し濃く */
    .tier-item[data-class-id="ELF"] { border-color: rgba(34, 197, 94, 0.38) !important; }
    .tier-item[data-class-id="ROYAL"] { border-color: rgba(245, 158, 11, 0.38) !important; }
    .tier-item[data-class-id="WITCH"] { border-color: rgba(168, 85, 247, 0.38) !important; }
    .tier-item[data-class-id="DRAGON"] { border-color: rgba(239, 68, 68, 0.38) !important; }
    .tier-item[data-class-id="NIGHTMARE"] { border-color: rgba(236, 72, 153, 0.38) !important; }
    .tier-item[data-class-id="BISHOP"] { border-color: rgba(234, 179, 8, 0.38) !important; }
    .tier-item[data-class-id="NEMESIS"] { border-color: rgba(6, 182, 212, 0.38) !important; }

    .tier-item.linkable[data-class-id="ELF"]:hover,
    .tier-item.linkable[data-class-id="ELF"]:focus-visible { border-color: rgba(34, 197, 94, 0.64) !important; }
    .tier-item.linkable[data-class-id="ROYAL"]:hover,
    .tier-item.linkable[data-class-id="ROYAL"]:focus-visible { border-color: rgba(245, 158, 11, 0.64) !important; }
    .tier-item.linkable[data-class-id="WITCH"]:hover,
    .tier-item.linkable[data-class-id="WITCH"]:focus-visible { border-color: rgba(168, 85, 247, 0.64) !important; }
    .tier-item.linkable[data-class-id="DRAGON"]:hover,
    .tier-item.linkable[data-class-id="DRAGON"]:focus-visible { border-color: rgba(239, 68, 68, 0.64) !important; }
    .tier-item.linkable[data-class-id="NIGHTMARE"]:hover,
    .tier-item.linkable[data-class-id="NIGHTMARE"]:focus-visible { border-color: rgba(236, 72, 153, 0.64) !important; }
    .tier-item.linkable[data-class-id="BISHOP"]:hover,
    .tier-item.linkable[data-class-id="BISHOP"]:focus-visible { border-color: rgba(234, 179, 8, 0.64) !important; }
    .tier-item.linkable[data-class-id="NEMESIS"]:hover,
    .tier-item.linkable[data-class-id="NEMESIS"]:focus-visible { border-color: rgba(6, 182, 212, 0.64) !important; }

    .tier-item.linkable:hover,
    .tier-item.linkable:focus-visible {
      background: #fff !important;
      box-shadow: 0 14px 26px rgba(17, 24, 39, 0.10) !important;
    }
    /* クラス色の枠線を維持（不明のときだけアクセントに寄せる） */
    .tier-item.linkable[data-class-id=""]:hover,
    .tier-item.linkable[data-class-id=""]:focus-visible {
      border-color: rgba(37, 99, 235, 0.55) !important;
    }
    .tier-item.linkable:focus-visible {
      outline: 3px solid rgba(37, 99, 235, 0.35);
      outline-offset: 2px;
    }
    .tier-item .content { background: transparent !important; }
    .tier-row1 .title,
    .tier-row1 .class-chip,
    .tier-row2 { color: var(--text) !important; }
    /* アーキタイプ名が長い場合（5文字以上）は少しだけ縮める */
    .tier-item[data-name-long="1"] .tier-row1 .class-chip .chip-text {
      font-size: 18px !important;
      letter-spacing: 0 !important;
    }
    .tier-row1 .tier-score {
      color: var(--text) !important;
      text-shadow: none !important;
      background: transparent !important;
      border: 0 !important;
      border-radius: 0 !important;
      padding: 0 !important;
      box-shadow: none !important;
      font-variant-numeric: tabular-nums;
      position: relative;
      z-index: 2;
    }
    /* %（スコア）だけは薄い白グラデを敷いて、画像に被っても読めるようにする */
    .tier-row1 .tier-score::before {
      content: "";
      position: absolute;
      top: -10px;
      bottom: -10px;
      /* 左のアーキタイプ名に被らないよう、左側は score の範囲内に留める */
      left: 0;
      /* 右側（画像側）にだけ広げて読みやすさを確保 */
      right: -48px;
      z-index: -1;
      pointer-events: none;
      border-radius: 999px;
      background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.94) 0%,
        rgba(255, 255, 255, 0.78) 42%,
        rgba(255, 255, 255, 0.28) 72%,
        rgba(255, 255, 255, 0.0) 100%
      );
      filter: blur(4px);
      opacity: 0.98;
    }

    /* カード側の薄い白グラデ（画像の見栄え調整用）は残す */
    .tier-item::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: calc(100% - var(--tier-bg-width) + 140px);
      border-radius: inherit;
      z-index: 1;
      pointer-events: none;
      background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.26) 0%,
        rgba(255, 255, 255, 0.16) 55%,
        rgba(255, 255, 255, 0.0) 100%
      );
      filter: blur(2px);
      opacity: 0.92;
    }
    .tier-row2 { color: var(--muted) !important; }
    /* カード2行目は主張を弱める */
    .tier-row2 {
      color: rgba(26, 31, 43, 0.55) !important;
      font-size: 11.5px !important;
      font-weight: 650 !important;
    }
    .tier-link-icon { color: var(--accent) !important; }

    .tier-symbol-bg {
      background: transparent !important;
      border: 0 !important;
      z-index: 0 !important;
    }
    .tier-symbol-bg::after {
      background: transparent !important;
    }
    .tier-symbol-thumb {
      background: transparent !important;
      border: 0 !important;
    }
    .tier-symbol-thumb img { transform: translateZ(0); }
    .tier-note { color: var(--muted) !important; }
    /* 参考（試合数不足）：重く見えないように薄いカード＋折りたたみ */
    .tier-ref {
      margin-top: 14px !important;
      border: 1px solid var(--line) !important;
      border-radius: 14px !important;
      padding: 10px 12px !important;
      background: #fff !important;
      box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06) !important;
    }
    .tier-ref summary {
      cursor: pointer;
      list-style: none;
      font-weight: 900;
      color: var(--text);
      letter-spacing: 0.2px;
      padding: 4px 0;
    }
    .tier-ref summary::-webkit-details-marker { display: none; }
    .tier-ref summary::after {
      content: "▼";
      font-size: 12px;
      color: var(--muted);
      margin-left: 8px;
    }
    .tier-ref[open] summary::after { content: "▲"; }
    .tier-ref .title { display: none; }
    .tier-ref .list { margin-top: 10px; }
    .tier-ref .pill {
      border: 1px solid var(--line) !important;
      background: #fff !important;
      color: var(--text) !important;
    }

    /* マッチアップ表 */
    .matchup-grid { border: 1px solid var(--line) !important; background: #fff !important; }
    .matchup-grid {
      --match-rowhead-w: 150px;
      --match-col-w: 80px; /* だいたい6文字の7割くらい */
      --match-row-name-w: 96px; /* 1列目（行見出し）の名前欄の固定幅 */
    }
    .matchup-table th,
    .matchup-table td {
      border-bottom: 1px solid var(--line) !important;
      border-right: 1px solid var(--line) !important;
      color: var(--text) !important;
    }
    .matchup-table thead th,
    .matchup-table .row-head {
      background: #F6F8FB !important;
      color: var(--text) !important;
      border-bottom: 1px solid var(--line) !important;
    }
    .matchup-table thead th { top: 0 !important; z-index: 10 !important; }
    .matchup-table thead th.row-head { z-index: 11 !important; }
    .matchup-table tbody th.row-head { z-index: 9 !important; }
    .matchup-table .row-head { text-align: center !important; }
    .matchup-table .row-head { width: var(--match-rowhead-w); min-width: var(--match-rowhead-w); max-width: var(--match-rowhead-w); }
    .matchup-table.matchup-archetype { table-layout: fixed; }
    .matchup-table.matchup-archetype th.center,
    .matchup-table.matchup-archetype td { width: var(--match-col-w); min-width: var(--match-col-w); max-width: var(--match-col-w); }
    .matchup-table.matchup-archetype th,
    .matchup-table.matchup-archetype td { padding: 4px 6px !important; }

    .matchup-chip {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      line-height: 1.1;
    }
    .matchup-chip img {
      width: 22px;
      height: 22px;
      object-fit: contain;
      border-radius: 8px;
      opacity: 0.95;
    }
    .matchup-chip .name {
      max-width: calc(var(--match-col-w) - 10px);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-weight: 850;
      font-size: 12px;
      color: var(--text);
    }
    .matchup-chip.is-row {
      display: inline-flex;
      flex-direction: row;
      justify-content: flex-start;
      gap: 8px;
      /* セル内で中央寄せしつつ、全行で左端位置を揃える（名前欄を固定幅にする） */
      margin: 0 auto;
    }
    .matchup-chip.is-row .name {
      width: var(--match-row-name-w);
      font-size: 13px;
      text-align: left;
    }
    .cell-winrate {
      background: #fff !important;
      color: var(--text) !important;
      border: 1px solid var(--line) !important;
      border-radius: 8px;
    }
    .cell-winrate .bar {
      /* JS側で勝率に応じて上書きする（!important で潰さない） */
      background: linear-gradient(135deg, rgba(37, 99, 235, 0.20), rgba(37, 99, 235, 0.06));
    }
    .cell-winrate .content { padding: 6px 6px; gap: 2px; }
    .cell-winrate .content > div:first-child {
      font-size: 16px;
      font-weight: 900;
    }
    .cell-winrate .meta {
      color: #94A3B8 !important;
      font-size: 10px;
      font-weight: 800;
    }
    .cell-empty { color: var(--muted) !important; }

    /* マリガンガイド（固定ヘッダ/左列） */
    #guide-table .guide-table thead th,
    #guide-table .guide-table td:first-child {
      background: #F6F8FB !important;
      color: var(--text) !important;
      border-bottom: 1px solid var(--line) !important;
    }

    /* ヘッダと重複する見出しは非表示 */
    .page > header .title-row h1 { display: none !important; }
    .page > header .title-row { justify-content: flex-end; }
    /* 最終更新日はTier表のメタに寄せる */
    .page > header .last-updated { display: none !important; }

    /* モバイル検索UIの操作性調整 */
    #guide-filters button,
    #tier-filters button,
    #matchup-filters button {
      line-height: 1.2 !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
    }

    @media (max-width: 768px) {
      /* ランクは「1行目:ラベル / 2行目以降:アイコン」の明示レイアウト */
      #rank-filter-guide,
      #rank-filter-match,
      #rank-filter-tier {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
      }
      #rank-filter-guide .label,
      #rank-filter-match .label,
      #rank-filter-tier .label {
        justify-self: start !important;
        text-align: left !important;
        margin: 0 !important;
      }
      #rank-filter-guide .filter-buttons,
      #rank-filter-match .filter-buttons,
      #rank-filter-tier .filter-buttons {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
      }
      #rank-filter-guide .filter-buttons button,
      #rank-filter-match .filter-buttons button,
      #rank-filter-tier .filter-buttons button {
        min-height: 44px;
        padding: 0 8px !important;
      }
      #rank-filter-guide .filter-buttons button.all-btn,
      #rank-filter-match .filter-buttons button.all-btn,
      #rank-filter-tier .filter-buttons button.all-btn {
        grid-column: 1 / -1;
      }

      /* Tier閾値は3項目を横並び維持して不自然な改行を抑制 */
      #tier-threshold-filter {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
      }
      #tier-threshold-filter .label {
        justify-self: start !important;
        text-align: left !important;
      }
      #tier-threshold-filter .filter-buttons {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: 100%;
      }
      #tier-threshold-filter .checkbox {
        margin-left: 0 !important;
        flex: 1 1 0;
        min-width: 0;
        justify-content: space-between;
        white-space: nowrap;
      }
      #tier-threshold-filter .cr-input {
        width: 52px;
        min-width: 52px;
      }
    }

    /* 詳細検索ラベル位置の統一 */
    .detail-panel .class-filter .label,
    .detail-panel .scenario-wrap .label {
      justify-self: start !important;
      text-align: left !important;
    }

    /* リセットボタンは左端に寄せる */
    .detail-panel .detail-actions {
      justify-content: flex-start !important;
      padding-left: 0 !important;
    }

    /* Tier: 最低試合数を独立行として見やすく */
    #tier-min-games-filter .filter-buttons {
      display: flex !important;
      align-items: center;
      justify-content: flex-start;
      width: 100%;
    }
    #tier-min-games-filter .cr-input {
      width: 84px;
      min-width: 84px;
    }

    /* 通常検索条件: クラスの次にアーキタイプを表示（縦並び） */
    #guide-filters .guide-sub-row {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 8px !important;
    }
    #guide-filters .guide-sub-row > * {
      width: 100%;
    }

    /* モバイル: ランク/グループ/アーキタイプをボトムシート選択へ */
    .mobile-sheet-target .sheet-trigger {
      display: none !important;
    }
    .sheet-trigger-value {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      overflow: hidden;
    }
    .sheet-trigger-value img {
      width: 22px;
      height: 22px;
      object-fit: contain;
      border-radius: 8px;
      flex: 0 0 auto;
    }
    .sheet-trigger-text {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .sheet-trigger-caret {
      margin-left: auto;
      color: #64748B;
      font-size: 11px;
      line-height: 1;
      flex: 0 0 auto;
    }

    .mobile-filter-sheet-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.42);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.18s ease;
      z-index: 1200;
    }
    .mobile-filter-sheet {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      background: #fff;
      border-radius: 16px 16px 0 0;
      padding: 10px 12px 14px;
      transform: translateY(100%);
      transition: transform 0.22s ease;
      max-height: 72vh;
      display: flex;
      flex-direction: column;
      box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.22);
    }
    .mobile-filter-sheet-backdrop.open {
      opacity: 1;
      pointer-events: auto;
    }
    .mobile-filter-sheet.open {
      transform: translateY(0);
    }
    .mobile-filter-sheet-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--line);
    }
    .mobile-filter-sheet-title {
      color: var(--text);
      font-size: 15px;
      font-weight: 850;
    }
    .mobile-filter-sheet-close {
      border: 1px solid var(--line);
      background: #fff;
      color: var(--muted);
      border-radius: 10px;
      height: 32px;
      padding: 0 10px;
      font-weight: 700;
      cursor: pointer;
    }
    .mobile-filter-sheet-list {
      display: grid;
      gap: 8px;
      margin-top: 10px;
      overflow: auto;
      padding-bottom: 8px;
    }
    .mobile-filter-sheet-item {
      border: 1px solid var(--line);
      background: #fff;
      color: var(--text);
      border-radius: 12px;
      min-height: 42px;
      padding: 0 10px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      justify-content: flex-start;
      font-weight: 800;
      text-align: left;
      cursor: pointer;
    }
    .mobile-filter-sheet-item.active {
      border-color: rgba(37, 99, 235, 0.55);
      background: rgba(37, 99, 235, 0.10);
    }
    .mobile-filter-sheet-item img {
      width: 22px;
      height: 22px;
      object-fit: contain;
      border-radius: 8px;
      flex: 0 0 auto;
    }
    body.mobile-filter-sheet-open {
      overflow: hidden;
    }

    @media (max-width: 768px) {
      .mobile-sheet-target .filter-buttons {
        display: block !important;
        width: 100%;
      }
      #guide-filters .mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
      #tier-filters .mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
      #matchup-filters .mobile-sheet-target .filter-buttons > button:not(.sheet-trigger) {
        display: none !important;
      }
      #guide-filters .mobile-sheet-target .filter-buttons > .sheet-trigger,
      #tier-filters .mobile-sheet-target .filter-buttons > .sheet-trigger,
      #matchup-filters .mobile-sheet-target .filter-buttons > .sheet-trigger {
        display: inline-flex !important;
        width: 100%;
        min-height: 44px;
        border: 1px solid var(--line);
        background: #fff;
        color: var(--text);
        border-radius: 12px;
        padding: 0 12px;
        justify-content: flex-start;
        box-shadow: none !important;
        transform: none !important;
      }
      #tier-min-games-filter {
        grid-template-columns: 1fr !important;
      }
      #tier-min-games-filter .label {
        justify-self: start !important;
        text-align: left !important;
      }
    }

    @media (min-width: 769px) {
      /* PCではシートトリガーを非表示（通常ボタンのみ） */
      #guide-filters .mobile-sheet-target .filter-buttons > .sheet-trigger,
      #tier-filters .mobile-sheet-target .filter-buttons > .sheet-trigger,
      #matchup-filters .mobile-sheet-target .filter-buttons > .sheet-trigger {
        display: none !important;
      }
      #guide-filters .mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
      #tier-filters .mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
      #matchup-filters .mobile-sheet-target .filter-buttons > button:not(.sheet-trigger) {
        display: inline-flex !important;
      }
    }

    /* 追加調整: 2026-02 モバイルUI */
    .detail-panel .class-filter .label,
    .detail-panel .scenario-wrap .label {
      justify-self: center !important;
      text-align: center !important;
    }

    #guide-filters .guide-top-actions {
      margin: 2px 0 8px !important;
      display: flex;
      justify-content: flex-start;
    }

    .detail-panel .filter-buttons .checkbox {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 38px;
      line-height: 1.2;
    }
    .detail-panel .filter-buttons .checkbox input[type="checkbox"] {
      margin: 0;
      width: 18px;
      height: 18px;
      flex: 0 0 auto;
    }

    #tier-min-games-filter .filter-buttons {
      flex-wrap: nowrap !important;
    }

    .sheet-trigger-text,
    .mobile-filter-sheet-item span {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    @media (max-width: 768px) {
      /* クラス/相手クラスを4列表示 */
      #guide-filters #class-filter .filter-buttons,
      #guide-filters #opp-filter .filter-buttons {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 8px !important;
      }
      #guide-filters #class-filter .filter-buttons button,
      #guide-filters #opp-filter .filter-buttons button {
        min-height: 44px;
      }
    }

/* ǉC: 2026-02-13 (follow-up) */
.detail-panel .class-filter .label,
.detail-panel .scenario-wrap .label {
  white-space: nowrap;
}
#tier-threshold-filter .label {
  justify-self: center !important;
  text-align: center !important;
}
.sheet-trigger-text {
  font-size: 14px;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  .page {
    width: 100%;
    max-width: 100%;
  }

  /* N/O[v̓gK[1Œ */
  #guide-filters #rank-filter-guide.mobile-sheet-target .filter-buttons,
  #matchup-filters #rank-filter-match.mobile-sheet-target .filter-buttons,
  #tier-filters #rank-filter-tier.mobile-sheet-target .filter-buttons,
  #guide-filters #group-filter.mobile-sheet-target .filter-buttons,
  #matchup-filters #group-filter-match.mobile-sheet-target .filter-buttons,
  #tier-filters #group-filter-tier.mobile-sheet-target .filter-buttons {
    display: block !important;
    width: 100%;
  }
  #guide-filters #rank-filter-guide.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #matchup-filters #rank-filter-match.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #tier-filters #rank-filter-tier.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #guide-filters #group-filter.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #matchup-filters #group-filter-match.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger),
  #tier-filters #group-filter-tier.mobile-sheet-target .filter-buttons > button:not(.sheet-trigger) {
    display: none !important;
  }
  #guide-filters #rank-filter-guide.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #matchup-filters #rank-filter-match.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #tier-filters #rank-filter-tier.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #guide-filters #group-filter.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #matchup-filters #group-filter-match.mobile-sheet-target .filter-buttons > .sheet-trigger,
  #tier-filters #group-filter-tier.mobile-sheet-target .filter-buttons > .sheet-trigger {
    display: inline-flex !important;
    width: 100%;
    min-height: 44px;
  }

  /* CRvZbg{gV[g */
  .cr-presets.mobile-sheet-target {
    display: block !important;
    width: 100%;
  }
  .cr-presets.mobile-sheet-target > button:not(.sheet-trigger) {
    display: none !important;
  }
  .cr-presets.mobile-sheet-target > .sheet-trigger {
    display: inline-flex !important;
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 12px;
    padding: 0 12px;
    justify-content: flex-start;
    box-shadow: none !important;
    transform: none !important;
  }

  /* Â nowrap/overflow wł */
  #cr-filter .filter-buttons,
  #cr-filter-match .filter-buttons,
  #cr-filter-tier .filter-buttons {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    gap: 8px !important;
  }
}

@media (max-width: 768px) {
  #rank-filter-guide .label,
  #rank-filter-match .label,
  #rank-filter-tier .label,
  #tier-min-games-filter .label {
    justify-self: start !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  #tier-threshold-filter .label,
  #detail-panel .scenario-wrap .label,
  #match-detail-panel .scenario-wrap .label {
    justify-self: center !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  #detail-panel .scenario-switch,
  #match-detail-panel .scenario-switch {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }
  #detail-panel .scenario-switch button,
  #match-detail-panel .scenario-switch button {
    min-width: 0 !important;
    width: 100% !important;
    padding: 0 6px !important;
    font-size: 13px !important;
  }

  #tier-min-games-filter .filter-buttons {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  #tier-min-games-filter .cr-input {
    width: 92px !important;
    min-width: 92px !important;
  }
}
