@import url("graa-shell.css?v=11");
@import url("item-list.css?v=4");

    /* Color tokens: graa-shell.css (data-theme on html) */

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: var(--font-ui);
      font-size: 13px;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    header {
      background: var(--surface-dark);
      border-bottom: 1px solid var(--border);
      padding: 1rem 1.5rem;
    }

    header h1 {
      margin: 0 0 0.25rem;
      font-size: 1.25rem;
      font-weight: bold;
      color: var(--title);
      
    }

    header p {
      margin: 0;
      color: var(--muted);
      font-size: 0.9rem;
    }

    .header-meta {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.35rem 0.5rem;
    }

    .header-meta-sep {
      color: var(--border);
    }

    .ko-fi-link {
      color: var(--link);
      font-weight: bold;
    }

    .ko-fi-link:hover {
      color: var(--text-bright);
    }

    header a {
      color: var(--link);
      text-decoration: underline;
    }

    header a:hover {
      color: var(--text-bright);
    }

    .status-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      align-items: center;
      padding: 0.75rem 1.5rem;
      background: var(--surface2);
      border-bottom: 1px solid var(--border);
      font-size: 0.85rem;
    }

    .status-bar-tools {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.75rem;
      margin-left: auto;
    }

    .status-bar-tools label {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.78rem;
      color: var(--muted);
      text-transform: none;
      letter-spacing: 0;
    }

    .status-bar-tools input[type="number"] {
      width: 5.5rem;
      padding: 0.3rem 0.45rem;
      background: var(--surface-dark);
      border: 1px solid var(--border);
      border-radius: 0;
      color: var(--text-bright);
      font-size: 0.82rem;
    }

    .status-bar-tools button {
      padding: 0.35rem 0.65rem;
      font-size: 0.78rem;
    }

    .status-toggle {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      font-size: 0.78rem;
      color: var(--muted);
      cursor: pointer;
    }

    .price-copyable {
      cursor: copy;
    }

    .price-copyable:hover {
      text-decoration: underline;
      text-decoration-style: dotted;
    }

    .item-cell {
      display: inline-flex;
      align-items: center;
      gap: 0.2rem;
      min-width: 0;
      max-width: 100%;
      width: max-content;
      overflow: hidden;
      vertical-align: middle;
    }

    .item-cell a.item-name {
      color: inherit;
      text-decoration: none;
      flex: 0 1 auto;
      min-width: 0;
      max-width: 12rem;
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-height: 1.2;
    }

    /* Wiki + member badge bloat item col width; available on item detail page */
    .col-item .item-wiki-link,
    .col-item .badge {
      display: none;
    }

    .item-cell a.item-name:hover {
      color: var(--link);
      text-decoration: underline;
    }

    .item-cell a.item-name[title],
    .recipe-item-head .recipe-name[title],
    .recipe-title[title] {
      cursor: help;
    }

    .star-btn {
      background: transparent;
      border: none;
      color: var(--muted);
      cursor: pointer;
      padding: 0;
      font-size: 1rem;
      line-height: 1;
      flex-shrink: 0;
    }

    .star-btn:hover,
    .star-btn.active {
      color: var(--link);
    }

    .recipe-best-banner {
      margin-bottom: 0.75rem;
      padding: 0.75rem 1rem;
      background: var(--surface-dark);
      border: 1px solid var(--border);
      border-radius: 0;
      font-size: 0.88rem;
      line-height: 1.45;
    }

    .recipe-best-banner[hidden] {
      display: none;
    }

    .site-footer {
      margin-top: 2rem;
      padding: 1.25rem 1.5rem 2rem;
      border-top: 1px solid var(--border);
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.55;
      text-align: center;
    }

    .site-footer a {
      color: var(--link);
    }

    .site-footer p {
      margin: 0.35rem 0;
    }

    .toast {
      position: fixed;
      bottom: 1.25rem;
      left: 50%;
      transform: translateX(-50%) translateY(120%);
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text-bright);
      padding: 0.55rem 1rem;
      border-radius: 0;
      font-size: 0.85rem;
      z-index: 1000;
      transition: transform 0.2s ease;
      pointer-events: none;
    }

    .toast.show {
      transform: translateX(-50%) translateY(0);
    }

    .status-bar .error { color: var(--red); }
    .status-bar .ok { color: var(--green); }

    .disclaimer {
      margin: 0;
      padding: 0.6rem 1.5rem;
      background: var(--surface-dark);
      border-bottom: 1px solid var(--border);
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.4;
    }

    html, body {
      overflow-x: hidden;
      max-width: 100%;
    }

    main {
      padding: 1rem 0 2rem;
      max-width: none;
      margin: 0;
      overflow-x: hidden;
    }

    .content-shell {
      display: grid;
      grid-template-columns: 160px minmax(0, 1fr) 160px;
      gap: 1rem;
      max-width: 1960px;
      margin: 0 auto;
      padding: 0 0.75rem;
      align-items: start;
    }

    body.ads-off .content-shell {
      grid-template-columns: minmax(0, 1fr);
      max-width: var(--g-max);
      padding: 0 1.5rem;
    }

    body.tool-page-wide .tool-main-column .content-shell {
      grid-template-columns: minmax(0, 1fr);
      max-width: none;
      padding: 0;
    }

    body.tool-page-wide .tool-main-column .page-main main,
    body.tool-page-wide .tool-main-column .tool-page-main main {
      padding: 0.75rem 1rem 1.25rem;
    }

    body.tool-page-wide .tool-main-column .tabs {
      margin-bottom: 0.75rem;
    }

    body.tool-page-wide .tool-main-column .filters {
      margin-bottom: 0.75rem;
    }

    body.ads-off .ad-rail {
      display: none;
    }

    body.ads-off main {
      padding: 1rem 0 2rem;
    }

    .ad-rail {
      position: sticky;
      top: 0.75rem;
      padding-top: 1rem;
    }

    .ad-slot {
      width: 160px;
      min-height: 600px;
      border: 2px dashed var(--border);
      border-radius: 0;
      background: var(--surface-dark);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 0.5rem;
      text-align: center;
      padding: 0.75rem 0.5rem;
      color: var(--muted);
      font-size: 0.72rem;
      line-height: 1.45;
    }

    .ad-slot-label {
      display: block;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      font-size: 0.62rem;
      color: var(--title);
    }

    .ad-slot-size {
      display: block;
      font-size: 0.68rem;
      opacity: 0.75;
    }

    .ad-slot-note {
      display: block;
      margin-top: auto;
      padding-top: 1rem;
      font-size: 0.65rem;
      opacity: 0.6;
    }

    .ad-slot:empty {
      min-height: 600px;
    }

    .ad-slot.has-ad {
      border-style: solid;
      border-color: var(--border);
      background: var(--surface);
      padding: 0;
      min-height: 0;
    }

    .ad-slot.has-ad .ad-slot-placeholder {
      display: none;
    }

    @media (max-width: 1280px) {
      .content-shell {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 1rem;
      }

      .ad-rail {
        display: none;
      }
    }

    .filters {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 0.75rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      padding: 1rem;
      margin-bottom: 1rem;
    }

    .filter-group {
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
    }

    .filter-group.wide { grid-column: span 2; }

    label {
      font-size: 0.75rem;
      color: var(--title);
      font-weight: bold;
      text-transform: none;
      letter-spacing: 0;
    }

    input, select {
      background: var(--surface-dark);
      border: 1px solid var(--border);
      color: var(--text-bright);
      padding: 0.45rem 0.5rem;
      border-radius: 0;
      font-size: 0.9rem;
      font-family: var(--font-ui);
    }

    input:focus, select:focus {
      outline: 1px dotted var(--link);
      border: 1px solid var(--border);
    }

    .toggles {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      align-items: center;
      grid-column: 1 / -1;
      padding-top: 0.25rem;
    }

    .toggle {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.9rem;
      color: var(--text);
      cursor: pointer;
    }

    .toggle input { width: auto; }

    .actions {
      grid-column: 1 / -1;
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .preset-filters {
      grid-column: 1 / -1;
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
      align-items: center;
      margin-bottom: 0.35rem;
    }

    .preset-label {
      font-size: 0.75rem;
      color: var(--title);
      font-weight: bold;
      text-transform: none;
      letter-spacing: 0;
      margin-right: 0.25rem;
    }

    .preset-btn {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text-bright);
      padding: 0.4rem 0.75rem;
      border-radius: 0;
      cursor: pointer;
      font-size: 0.82rem;
      font-family: var(--font-ui);
    }

    .preset-btn:hover {
      background: var(--surface);
      color: var(--link);
    }

    .preset-btn.active {
      background: var(--surface-dark);
      border: 1px solid var(--border);
      color: var(--link);
    }

    .preset-btn.active:hover {
      color: var(--text-bright);
    }

    button {
      background: var(--surface2);
      color: var(--text-bright);
      border: 1px solid var(--border);
      padding: 0.5rem 1rem;
      border-radius: 0;
      cursor: pointer;
      font-size: 0.9rem;
      font-family: var(--font-ui);
      font-weight: bold;
    }

    button:hover {
      color: var(--link);
    }

    button:active {
      border: 1px solid var(--border);
      background: var(--surface-dark);
    }

    .results-meta {
      margin-bottom: 0.75rem;
      color: var(--muted);
      font-size: 0.9rem;
    }

    .table-wrap {
      overflow-x: hidden;
      max-width: 100%;
      border: 1px solid var(--border);
      border-radius: 0;
      background: var(--surface);
    }

    .table-scroll-hint {
      display: none;
    }

    table {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      table-layout: auto;
      border-collapse: collapse;
      font-size: 0.78rem;
    }

    th, td {
      padding: 0.25rem 0.35rem;
      text-align: left;
      border-bottom: 1px solid var(--border);
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: middle;
    }

    th {
      white-space: normal;
      line-height: 1.2;
      font-size: 0.72rem;
      background: var(--surface-dark);
      color: var(--title);
      font-weight: bold;
      
      position: sticky;
      top: 0;
      z-index: 1;
    }

    td.price-buy, td.price-sell,
    th.col-price-buy, th.col-price-sell {
      white-space: nowrap;
      text-align: right;
      font-size: 0.72rem;
    }

    td.num, th.num {
      text-align: right;
      white-space: nowrap;
      font-size: 0.8125rem;
      overflow: visible;
      text-overflow: clip;
      width: 1%;
    }

    th.col-item, td.col-item,
    #transformsTable th.col-recipe,
    #transformsTable td.col-recipe {
      text-align: left;
    }

    @media (max-width: 767px) {
      .col-hide-narrow {
        display: none;
      }
    }

    @media (max-width: 480px) {
      .col-hide-xs {
        display: none;
      }
    }

    th.sortable {
      cursor: pointer;
      user-select: none;
    }

    th.sortable:hover { color: var(--text); }

    th.sortable.sorted-desc::after { content: " ▼"; font-size: 0.7rem; }
    th.sortable.sorted-asc::after { content: " ▲"; font-size: 0.7rem; }

    .price-buy { color: var(--blue); font-weight: bold; }
    .price-sell { color: var(--green); font-weight: bold; }

    .filters-title {
      grid-column: 1 / -1;
      margin: 0;
      font-size: 0.95rem;
      color: var(--title);
      font-weight: bold;
      
    }

    .filters-subtitle {
      grid-column: 1 / -1;
      margin: -0.25rem 0 0;
      font-size: 0.8rem;
      color: var(--muted);
    }

    .filters-subtitle code {
      color: var(--link);
      font-size: 0.78rem;
    }

    #transformsTable {
      font-size: 0.74rem;
    }


    #transformsTable th.col-io,
    #transformsTable td.recipe-io {
      min-width: 0;
      vertical-align: top;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: normal;
    }

    .recipe-item {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.08rem 0;
      line-height: 1.2;
      min-width: 0;
      overflow: hidden;
    }

    .recipe-item img {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
      image-rendering: pixelated;
    }

    .recipe-qty {
      color: var(--link);
      font-weight: bold;
      min-width: 1.5rem;
      flex-shrink: 0;
    }

    .recipe-name {
      flex: 0 1 auto;
      min-width: 0;
      max-width: 12rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-height: 1.2;
    }

    .recipe-title {
      display: block;
      font-weight: 600;
      margin-bottom: 0.1rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
      max-width: 12rem;
      line-height: 1.3;
    }

    .recipe-kind {
      display: block;
      color: var(--muted);
      font-size: 0.68rem;
    }

    .item-cell img {
      width: 28px;
      height: 28px;
      flex-shrink: 0;
      image-rendering: pixelated;
    }

    .item-name {
      font-weight: 600;
      flex: 0 1 auto;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-height: 1.2;
    }

    .item-cell .badge {
      flex-shrink: 0;
    }

    .badge {
      display: inline-block;
      font-size: 0.65rem;
      padding: 0.1rem 0.35rem;
      border-radius: 0;
      margin-left: 0.35rem;
      vertical-align: middle;
      border: 1px solid var(--border);
    }

    .badge-members { background: var(--surface-dark); color: var(--green); }
    .badge-f2p { background: var(--surface-dark); color: var(--blue); }

    .positive { color: var(--green); }
    .negative { color: var(--red); }
    .tax-lost { color: var(--red); }

    .loading {
      text-align: center;
      padding: 3rem;
      color: var(--muted);
    }

    .tabs {
      display: flex;
      gap: 0;
      margin-bottom: 1rem;
      border-bottom: 1px solid var(--border);
    }

    .tab {
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: var(--muted);
      padding: 0.65rem 1rem;
      border-radius: 0;
      margin: 0;
      font-weight: 500;
    }

    .tab.active {
      background: transparent;
      color: var(--title);
      border-bottom-color: var(--title);
      margin-bottom: 0;
      padding-bottom: 0.65rem;
    }

    .tab-panel { display: none; }
    .tab-panel.active { display: block; }

    .top10-note {
      margin: 0 0 0.75rem;
      color: var(--muted);
      font-size: 0.85rem;
    }

    .rank-cell {
      font-weight: bold;
      color: var(--link);
      width: 1.75rem;
      text-align: center;
      padding-left: 0.25rem;
      padding-right: 0.25rem;
    }

    .highlight-gp { color: var(--green); font-weight: bold; }

    tr:hover td { background: rgba(255, 152, 31, 0.08); }

    @media (max-width: 700px) {
      main { padding: 1rem; }
      table { font-size: 0.68rem; }
      th { font-size: 0.62rem; }
      th, td { padding: 0.28rem 0.18rem; }
      .item-cell img { width: 22px; height: 22px; }
      .filter-group.wide { grid-column: span 1; }
    }

    /* Site chrome: see graa-shell.css */

    body.site main a:not(.tool-card):not(.quick-start-btn):not(.btn-primary):not(.btn-secondary) {
      color: var(--link);
    }

    body.site main a:not(.tool-card):not(.quick-start-btn):hover {
      color: var(--text-bright);
    }

    .tool-page-main {
      max-width: var(--g-max);
      margin: 0 auto;
      width: 100%;
    }

    .auth-login {
      color: var(--link) !important;
      font-weight: bold;
    }

    .auth-user {
      color: var(--text);
      font-size: 0.82rem;
      margin-right: 0.25rem;
    }

    #authSlot {
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }

    .kofi-nav-cta {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--muted);
      font-weight: 500;
    }

    .kofi-nav-cta:hover {
      color: var(--text-bright);
    }

    .kofi-strip {
      margin-top: 2rem;
      padding: 0.75rem 1.25rem;
      background: var(--surface);
      border-top: 1px solid var(--border);
    }

    .kofi-strip-inner {
      max-width: 900px;
      margin: 0 auto;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 1rem;
      text-align: center;
    }

    .kofi-strip-text {
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.5;
    }

    .kofi-strip-text strong {
      color: var(--text);
    }

    .kofi-strip-btn {
      display: inline-block;
      padding: 0.45rem 0.9rem;
      background: var(--surface2);
      color: var(--link);
      font-weight: bold;
      text-decoration: underline;
      border-radius: 0;
      border: 1px solid var(--border);
      white-space: nowrap;
    }

    .kofi-strip-btn:hover {
      color: var(--text-bright);
    }

    body.recipes-only-page .tabs,
    body.recipes-only-page #searchPanel,
    body.recipes-only-page #top10Panel {
      display: none !important;
    }

    body.recipes-only-page #transformsPanel {
      display: block !important;
    }

    body.recipes-only-page .status-bar-tools label[for="flipQty"],
    body.recipes-only-page .status-bar-tools #flipQty {
      display: none;
    }

    .recipe-item-detailed {
      flex-direction: column;
      align-items: stretch;
      gap: 0.2rem;
      padding: 0.35rem 0;
      border-bottom: 1px dashed rgba(74, 60, 40, 0.5);
    }

    .recipe-item-detailed:last-child {
      border-bottom: none;
    }

    .recipe-item-head {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      min-width: 0;
      overflow: hidden;
    }

    .recipe-item-head .recipe-name {
      color: inherit;
      text-decoration: none;
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
      line-height: 1.2;
    }

    .recipe-item-head .recipe-name:hover {
      color: var(--link);
      text-decoration: underline;
    }

    .recipe-item-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem 0.65rem;
      font-size: 0.68rem;
      color: var(--muted);
      padding-left: 1.6rem;
    }

    .recipe-item-meta .price-copyable {
      font-weight: 600;
      cursor: copy;
    }

    .recipe-vol,
    .recipe-time {
      white-space: nowrap;
    }

    #transformsTable th.col-io,
    #transformsTable td.recipe-io {
      white-space: normal;
    }

    @media (max-width: 700px) {
      .site-nav {
        margin-left: 0;
        width: 100%;
      }

      .site-nav .nav-label {
        display: none;
      }
    }

    /* ── Navigation polish ── */
    .skip-link {
      position: absolute;
      left: -9999px;
      top: 0.5rem;
      z-index: 200;
      padding: 0.5rem 0.75rem;
      background: var(--surface2);
      color: var(--link);
      font-weight: bold;
      border-radius: 0;
      text-decoration: none;
      border: 2px solid var(--border);
    }

    .skip-link:focus {
      left: 0.75rem;
    }

    .nav-toggle {
      display: none;
      margin-left: auto;
      width: 2.5rem;
      height: 2.5rem;
      padding: 0.45rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      cursor: pointer;
      flex-direction: column;
      justify-content: center;
      gap: 0.28rem;
    }

    .nav-toggle span {
      display: block;
      height: 2px;
      background: var(--title);
      border-radius: 0;
    }

    .economy-subnav {
      max-width: var(--g-max);
      margin: 0 auto;
      padding: 0 1.25rem 0.75rem;
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
    }

    .economy-subnav a {
      color: var(--text);
      text-decoration: none;
      font-size: 0.78rem;
      padding: 0.35rem 0.65rem;
      border-radius: 0;
      border: 2px solid transparent;
      background: transparent;
      font-weight: bold;
    }

    .economy-subnav a:hover {
      color: var(--link);
    }

    .economy-subnav a.active {
      color: var(--link);
      border-color: var(--border);
      background: var(--surface);
    }

    .item-wiki-link {
      flex-shrink: 0;
      color: var(--muted);
      text-decoration: none;
      font-size: 0.72rem;
      padding: 0.1rem 0.25rem;
      border-radius: 3px;
      line-height: 1;
    }

    .item-wiki-link:hover {
      color: var(--link);
      background: var(--surface-dark);
    }

    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .link-btn {
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      font-size: inherit;
      padding: 0;
      text-decoration: underline;
    }

    .link-btn:hover {
      color: var(--red);
    }

    .auth-login,
    .auth-user {
      font-size: 0.82rem !important;
    }

    .auth-user {
      color: var(--text) !important;
    }

    /* ── Item detail ── */
    .item-lookup-bar {
      max-width: 720px;
      margin: 0 auto 1rem;
      padding: 0 1.25rem;
    }

    .item-lookup-bar input {
      width: 100%;
      padding: 0.65rem 0.85rem;
      background: var(--surface-dark);
      border: 1px solid var(--border);
      border-radius: 0;
      color: var(--text-bright);
      font-size: 0.95rem;
    }

    .item-lookup-results {
      max-width: 720px;
      margin: 0 auto;
      padding: 0 1.25rem 1rem;
    }

    .item-lookup-results a {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.65rem;
      color: inherit;
      text-decoration: none;
      border-radius: 0;
    }

    .item-lookup-results a span {
      flex: 1;
      min-width: 0;
      line-height: 1.35;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .item-lookup-results a:hover {
      background: var(--surface2);
    }

    .item-detail-card {
      max-width: 900px;
      margin: 0 auto 2rem;
      padding: 0 1.25rem;
    }

    .item-detail-header img {
      width: 48px;
      height: 48px;
      image-rendering: pixelated;
    }

    .item-detail-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
    }

    .stat-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 0.65rem;
      margin-bottom: 1rem;
    }

    .item-detail-header {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 1rem;
      padding: 1rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      margin-bottom: 1rem;
    }

    .item-detail-header h1 {
      margin: 0;
      font-size: 1.15rem;
      font-weight: bold;
      color: var(--title);
      
      flex: 1;
      min-width: 0;
    }

    .item-detail-actions a {
      font-size: 0.82rem;
      padding: 0.35rem 0.65rem;
      border-radius: 0;
      border: 1px solid var(--border);
      color: var(--text-bright);
      text-decoration: none;
      font-weight: bold;
    }

    .item-detail-actions a:hover {
      color: var(--link);
    }

    .stat-card {
      background: var(--surface-dark);
      border: 1px solid var(--border);
      border-radius: 0;
      padding: 0.75rem;
    }

    .stat-card .label {
      display: block;
      font-size: 0.68rem;
      text-transform: none;
      letter-spacing: 0;
      color: var(--title);
      font-weight: bold;
      margin-bottom: 0.25rem;
    }

    .stat-card .value {
      font-size: 1rem;
      font-weight: bold;
      color: var(--text-bright);
    }

    .sparkline-wrap {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      padding: 1rem;
      margin-bottom: 1rem;
    }

    .sparkline-wrap h2 {
      margin: 0 0 0.75rem;
      font-size: 0.9rem;
      color: var(--title);
      font-weight: bold;
      
    }

    .sparkline-legend {
      display: flex;
      gap: 1rem;
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 0.5rem;
    }

    .sparkline-legend .sell { color: var(--green); }
    .sparkline-legend .buy { color: var(--blue); }

    .price-sparkline {
      width: 100%;
      height: 80px;
      display: block;
    }

    /* ── Flip log ── */
    .flip-log-form {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 0.75rem;
      margin-bottom: 1rem;
    }

    .flip-log-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem 2rem;
      padding: 1rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      margin-bottom: 1rem;
    }

    .flip-log-summary strong {
      color: var(--link);
    }

    /* ── Upgrade ── */
    .upgrade-grid {
      max-width: 900px;
      margin: 0 auto;
      padding: 0 1.25rem 2rem;
      display: grid;
      gap: 1.25rem;
    }

    .upgrade-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      padding: 1rem;
    }

    .upgrade-card h2 {
      margin: 0 0 0.5rem;
      font-size: 1rem;
      font-weight: bold;
      color: var(--title);
      
    }

    .upgrade-card ul {
      margin: 0.5rem 0 0;
      padding-left: 1.2rem;
      color: var(--muted);
      line-height: 1.6;
    }

    .upgrade-status {
      padding: 0.75rem 1rem;
      border-radius: 0;
      background: var(--surface-dark);
      border: 2px solid var(--green-dim);
      color: var(--green);
      margin-bottom: 1rem;
    }

    .home-live-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 0.75rem;
      margin: 1.5rem 0 2rem;
    }

    .home-live-stat {
      text-align: center;
      padding: 0.75rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
    }

    .home-live-stat .num {
      display: block;
      font-size: 1.1rem;
      font-weight: bold;
      color: var(--link);
    }

    .home-live-stat .lbl {
      font-size: 0.72rem;
      color: var(--muted);
      text-transform: none;
      letter-spacing: 0;
    }

    .home-changelog-snippet {
      margin-top: 2rem;
      padding: 0;
      background: transparent;
      border: none;
      border-radius: 0;
    }

    .home-changelog-snippet h2 {
      margin: 0;
    }

    .home-changelog-snippet ul {
      margin: 0;
      padding-left: 1.2rem;
      color: var(--muted);
      line-height: 1.6;
    }

    .guide-article {
      max-width: 720px;
      margin: 0 auto;
      padding: 2rem 1.25rem 3rem;
      line-height: 1.65;
    }

    .guide-article h1 {
      font-weight: bold;
      color: var(--title);
      
    }

    .guide-article h2 {
      font-size: 1rem;
      color: var(--title);
      font-weight: bold;
      margin-top: 1.5rem;
    }

    .prep-section {
      margin-bottom: 1.25rem;
    }

    .prep-section h2 {
      font-size: 0.95rem;
      color: var(--title);
      font-weight: bold;
      margin: 0 0 0.5rem;
    }

    .prep-checklist {
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .prep-checklist li {
      padding: 0.35rem 0;
      border-bottom: 1px solid var(--border);
    }

    .prep-checklist label {
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    @media (max-width: 860px) {
      .nav-toggle {
        display: flex;
      }

      .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
      }

      body.nav-open .site-nav {
        display: flex;
      }

      .site-header-inner {
        flex-wrap: wrap;
      }

      #authSlot,
      .header-actions {
        width: auto;
        justify-content: flex-start;
        padding-top: 0;
      }

      .economy-subnav,
      .tool-subnav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
      }

      .header-search {
        order: 3;
        width: 100%;
        max-width: none;
      }

      .nav-dropdown-panel {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0.25rem 0 0.5rem 0.75rem;
        display: none;
      }

      .nav-dropdown.open .nav-dropdown-panel {
        display: block;
      }
    }

    /* ── Hub navigation (Garmoth-inspired clarity) ── */
    .header-search {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      flex: 1;
      max-width: 220px;
      min-width: 140px;
      background: var(--surface-dark);
      border: 1px solid var(--border);
      border-radius: 0;
      padding: 0.2rem 0.45rem 0.2rem 0.65rem;
    }

    .header-search input {
      flex: 1;
      min-width: 0;
      border: none;
      background: transparent;
      color: var(--text);
      font-size: 0.82rem;
      outline: none;
    }

    .header-search button {
      background: transparent;
      border: none;
      color: var(--link);
      cursor: pointer;
      font-size: 1rem;
      padding: 0.2rem 0.4rem;
      line-height: 1;
      font-weight: bold;
    }

    .nav-dropdown {
      position: relative;
    }

    .nav-dropdown-trigger {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
    }

    .nav-dropdown-trigger.active {
      color: var(--link);
      border-color: var(--border);
      background: var(--surface);
    }

    .nav-dropdown-panel {
      display: none;
      position: absolute;
      top: calc(100% + 0.35rem);
      left: 0;
      min-width: 240px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      box-shadow: var(--g-shadow, 0 4px 16px rgba(0,0,0,0.15));
      padding: 0.25rem;
      z-index: 200;
    }

    /* Invisible bridge so pointer can cross the gap without closing hover */
    @media (min-width: 861px) {
      .nav-dropdown-panel::before {
        content: "";
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        height: 0.35rem;
      }
    }

    .nav-dropdown:hover .nav-dropdown-panel,
    .nav-dropdown:focus-within .nav-dropdown-panel {
      display: block;
    }

    .nav-chevron {
      font-size: 0.65rem;
      opacity: 0.7;
    }

    .nav-dropdown-item {
      display: flex;
      flex-direction: column;
      gap: 0.1rem;
      padding: 0.45rem 0.55rem;
      border-radius: 0;
      text-decoration: none;
      color: inherit;
    }

    .nav-dropdown-item:hover {
      background: var(--surface2);
    }

    .nav-dropdown-item-label {
      font-weight: bold;
      font-size: 0.88rem;
      color: var(--text-bright);
    }

    .nav-dropdown-item-desc {
      font-size: 0.72rem;
      color: var(--muted);
    }

    .nav-dropdown-footer {
      display: block;
      padding: 0.45rem 0.55rem;
      margin-top: 0.15rem;
      border-top: 1px solid var(--border-dark);
      font-size: 0.75rem;
      color: var(--link);
      text-decoration: underline;
    }

    .breadcrumbs {
      font-size: 0.75rem;
      color: var(--muted);
      margin-bottom: 0.5rem;
    }

    .breadcrumbs a {
      color: var(--muted);
      text-decoration: underline;
    }

    .breadcrumbs a:hover {
      color: var(--link);
    }

    .breadcrumbs [aria-current="page"] {
      color: var(--text-bright);
    }

    .bc-sep {
      margin: 0 0.35rem;
      opacity: 0.5;
    }

    .tool-subnav,
    .economy-subnav {
      max-width: var(--g-max);
      margin: 0 auto;
      padding: 0 1.25rem;
      display: flex;
      flex-wrap: wrap;
      gap: 0;
      border-bottom: 1px solid var(--border);
      background: var(--surface-dark);
    }

    .tool-subnav a,
    .economy-subnav a {
      color: var(--text);
      text-decoration: none;
      font-size: 0.8rem;
      padding: 0.5rem 0.75rem;
      border-radius: 0;
      border: 2px solid transparent;
      border-bottom: none;
      margin-bottom: -2px;
      font-weight: bold;
    }

    .tool-subnav a:hover,
    .economy-subnav a:hover {
      color: var(--link);
      background: transparent;
    }

    .tool-subnav a.active,
    .economy-subnav a.active {
      color: var(--link);
      background: var(--surface);
      border: 1px solid var(--border); border-bottom-color: var(--surface);
    }

    .quick-start {
      margin-bottom: 1.5rem;
    }

    .quick-start-lead {
      color: var(--muted);
      margin: -0.25rem 0 0.75rem;
      font-size: 0.88rem;
    }

    .quick-start-btn {
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
      padding: 0.65rem 0.85rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      text-decoration: none;
      color: inherit;
    }

    .quick-start-btn:hover {
      background: var(--surface2);
    }

    .quick-start-btn strong {
      color: var(--title);
      font-size: 0.88rem;
      
    }

    .quick-start-btn span {
      font-size: 0.72rem;
      color: var(--muted);
    }

    .quick-start-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 0.65rem;
    }

    .tools-hub-main {
      max-width: var(--g-max);
      margin: 0 auto;
      padding: 0 1.25rem 3rem;
    }

    .tools-hub-section {
      margin-bottom: 2rem;
    }

    .tools-hub-section h2 {
      color: var(--title);
      font-weight: bold;
      
      margin: 0 0 0.35rem;
      font-size: 1rem;
    }

    .tool-summary-strip {
      max-width: var(--g-max);
      margin: 0 auto;
      padding: 0.65rem 1.25rem;
      background: var(--surface-dark);
      border-bottom: 1px solid var(--border);
    }

    .tool-summary-label {
      font-size: 0.65rem;
      text-transform: none;
      letter-spacing: 0;
      color: var(--title);
      font-weight: bold;
    }

    a.tool-summary-value:hover {
      color: var(--link);
    }

    .tool-tip-bar {
      max-width: var(--g-max);
      margin: 0 auto;
      padding: 0.5rem 1.25rem;
      font-size: 0.78rem;
      color: var(--muted);
      border-bottom: 1px solid var(--border-dark);
      background: var(--surface-dark);
    }

    .tool-tip-bar kbd {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0;
      padding: 0.05rem 0.35rem;
      font-size: 0.72rem;
    }

    .tools-hub-blurb {
      color: var(--muted);
      margin: 0 0 1rem;
      font-size: 0.88rem;
    }

    .page-hero {
      padding-bottom: 0.5rem;
    }

    .disclaimer {
      max-width: var(--g-max);
      margin: 0 auto;
      padding: 0 1.25rem;
      font-size: 0.78rem;
      color: var(--muted);
      line-height: 1.5;
    }

    .tool-summary-inner {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 0.65rem 1rem;
    }

    .tool-summary-card {
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
      min-width: 0;
    }

    .tool-summary-value {
      font-size: 1.05rem;
      font-weight: bold;
      color: var(--text-bright);
      text-decoration: none;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .tool-summary-value.highlight-gp {
      color: var(--green);
    }

    .tool-summary-hint {
      font-size: 0.68rem;
      color: var(--muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    @media (max-width: 768px) {
      .filters,
      .flip-log-form {
        grid-template-columns: 1fr;
      }

      .filter-group.wide {
        grid-column: span 1;
      }

      .filters input,
      .filters select,
      .flip-log-form input,
      .flip-log-form select {
        width: 100%;
      }

      .toggles {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
      }

      .preset-filters {
        gap: 0.35rem;
      }

      .preset-btn {
        min-height: 2.75rem;
      }

      .actions {
        flex-direction: column;
      }

      .actions button {
        width: 100%;
      }

      .status-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
      }

      .status-bar-tools {
        margin-left: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
      }

      .status-bar-tools label,
      .status-bar-tools button {
        width: 100%;
        justify-content: center;
      }

      .status-bar-tools input[type="number"] {
        width: 100%;
      }

      .stat-grid {
        grid-template-columns: repeat(2, 1fr);
      }

      .home-live-stats {
        grid-template-columns: repeat(2, 1fr);
      }

      .quick-start-grid {
        grid-template-columns: 1fr;
      }

      .tool-summary-inner {
        grid-template-columns: repeat(2, 1fr);
      }

      .flip-log-summary {
        flex-direction: column;
        gap: 0.65rem;
      }

      .item-detail-header {
        flex-direction: column;
        align-items: flex-start;
      }

      .item-detail-actions {
        width: 100%;
      }

      .item-detail-actions a {
        flex: 1 1 auto;
        text-align: center;
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      .item-lookup-bar,
      .item-lookup-results,
      .item-detail-card {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
      }

      .guide-article {
        padding: 1.25rem max(1rem, env(safe-area-inset-left)) 2rem max(1rem, env(safe-area-inset-right));
      }

      .upgrade-grid {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
      }

      .content-shell {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
      }
    }

    @media (max-width: 480px) {
      .stat-grid,
      .home-live-stats,
      .tool-summary-inner {
        grid-template-columns: 1fr;
      }

      .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
      }

      .tabs::-webkit-scrollbar {
        display: none;
      }

      .tab {
        flex-shrink: 0;
        white-space: nowrap;
      }

    }

    .tool-page-shell {
      max-width: var(--g-max);
      margin: 0 auto;
      width: 100%;
    }
