/* st-trade shared and page styles. Extracted from Jinja templates so browsers can cache them. */

/* Source: base.html */
      :root {
        --bg: #f5f7fb;
        --panel: #ffffff;
        --panel-soft: #f8fafc;
        --panel-strong: #edf2f7;
        --text: #151821;
        --muted: #707789;
        --muted-strong: #4b5565;
        --line: #d9dee8;
        --line-strong: #b7c0cf;
        --accent: #2563eb;
        --accent-strong: #1d4ed8;
        --accent-soft: #eaf1ff;
        --accent-muted: #60a5fa;
        --warn: #b7791f;
        --warn-soft: #fff7df;
        --good: #0f9f6e;
        --good-soft: #e4f8ef;
        --bad: #d92d20;
        --bad-soft: #fff0ef;
        --purple: #7c3aed;
        --purple-soft: #f4efff;
        --teal: #0d9488;
        --teal-soft: #e0f8f5;
        --nav-bg: #111318;
        --nav-bg-strong: #0c0e12;
        --nav-panel: rgba(255, 255, 255, 0.06);
        --nav-line: rgba(255, 255, 255, 0.11);
        --nav-text: #f4f7fb;
        --nav-muted: #9da5b8;
        --shadow: 0 18px 42px rgba(17, 24, 39, 0.09);
        --shadow-soft: 0 8px 22px rgba(17, 24, 39, 0.06);
        --shadow-tight: 0 1px 2px rgba(17, 24, 39, 0.08), 0 8px 20px rgba(17, 24, 39, 0.05);
        --radius: 8px;
      }
      * { box-sizing: border-box; }
      [hidden] { display: none !important; }
      html { color-scheme: light; }
      body {
        margin: 0;
        background:
          linear-gradient(90deg, rgba(21, 24, 33, 0.03) 1px, transparent 1px),
          linear-gradient(180deg, rgba(21, 24, 33, 0.03) 1px, transparent 1px),
          var(--bg);
        background-size: 32px 32px, 32px 32px, auto;
        color: var(--text);
        font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        font-size: 14px;
        line-height: 1.5;
        font-variant-numeric: tabular-nums;
      }
      .app-shell {
        display: grid;
        grid-template-columns: 264px minmax(0, 1fr);
        min-height: 100vh;
      }
      .sidebar {
        background:
          linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 38%),
          var(--nav-bg);
        border-right: 1px solid rgba(0, 0, 0, 0.32);
        box-shadow: inset -1px 0 0 var(--nav-line);
        height: 100vh;
        overflow-y: auto;
        padding: 18px;
        position: sticky;
        top: 0;
      }
      .sidebar-inner {
        display: grid;
        gap: 20px;
        grid-template-rows: auto 1fr auto;
        min-height: calc(100vh - 36px);
      }
      .topbar,
      .auth-header {
        border-bottom: 1px solid rgba(217, 222, 232, 0.9);
        background: rgba(255, 255, 255, 0.86);
        box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
        position: sticky;
        top: 0;
        z-index: 10;
        backdrop-filter: blur(18px) saturate(140%);
      }
      .topbar-inner,
      .auth-header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 58px;
        padding: 12px 28px;
        gap: 18px;
      }
      .topbar-title {
        display: grid;
        gap: 2px;
      }
      .topbar-title strong {
        font-size: 13px;
        letter-spacing: 0;
      }
      .topbar-title span {
        color: var(--muted);
        font-size: 12px;
        font-weight: 650;
      }
      .topbar-meta {
        align-items: center;
        display: flex;
        gap: 8px;
      }
      .topbar-badge {
        background: var(--panel-soft);
        border: 1px solid var(--line);
        border-radius: 999px;
        color: var(--muted-strong);
        display: inline-flex;
        font-size: 12px;
        font-weight: 750;
        min-height: 28px;
        padding: 5px 10px;
      }
      .brand {
        align-items: center;
        color: var(--nav-text);
        display: flex;
        gap: 10px;
        font-weight: 800;
        font-size: 18px;
        min-height: 40px;
        text-decoration: none;
      }
      .brand-mark {
        align-items: center;
        background:
          linear-gradient(135deg, #f43f5e 0%, #f59e0b 48%, #14b8a6 100%);
        border-radius: 8px;
        box-shadow: 0 10px 22px rgba(20, 184, 166, 0.18);
        color: #fff;
        display: inline-flex;
        height: 36px;
        justify-content: center;
        font-size: 13px;
        font-weight: 800;
        width: 36px;
      }
      .brand-copy {
        color: inherit;
        display: grid;
        gap: 1px;
        font-size: 18px;
        font-weight: 800;
      }
      .brand-copy span {
        color: var(--nav-muted);
        font-size: 12px;
        font-weight: 600;
      }
      .sidebar-head {
        display: grid;
        gap: 10px;
      }
      .global-plugin-status {
        align-items: center;
        background: rgba(255, 255, 255, 0.07);
        border: 1px solid var(--nav-line);
        border-radius: var(--radius);
        color: rgba(244, 247, 251, 0.9);
        display: grid;
        gap: 9px;
        grid-template-columns: auto minmax(0, 1fr);
        min-height: 44px;
        padding: 8px 10px;
        text-decoration: none;
        transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
      }
      .global-plugin-status:hover {
        background: var(--nav-panel);
        border-color: rgba(255, 255, 255, 0.18);
        color: var(--nav-text);
      }
      .plugin-light {
        background: #6b7280;
        border: 1px solid rgba(255, 255, 255, 0.26);
        border-radius: 999px;
        box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.18);
        height: 11px;
        width: 11px;
      }
      .global-plugin-status[data-connection="online"] .plugin-light {
        background: var(--good);
        box-shadow: 0 0 0 3px rgba(15, 159, 110, 0.18), 0 0 14px rgba(15, 159, 110, 0.28);
      }
      .global-plugin-status[data-connection="offline"] .plugin-light,
      .global-plugin-status[data-connection="error"] .plugin-light {
        background: var(--bad);
        box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.18), 0 0 14px rgba(217, 45, 32, 0.22);
      }
      .plugin-status-copy {
        display: grid;
        gap: 1px;
        min-width: 0;
      }
      .plugin-status-copy strong {
        color: inherit;
        font-size: 12px;
        font-weight: 800;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .plugin-status-copy span {
        color: var(--nav-muted);
        font-size: 11px;
        font-weight: 680;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .global-plugin-status[data-connection="online"] .plugin-status-copy span {
        color: #a7f3d0;
      }
      .global-plugin-status[data-connection="offline"] .plugin-status-copy span,
      .global-plugin-status[data-connection="error"] .plugin-status-copy span {
        color: #fecaca;
      }
      .auth-header .brand {
        color: var(--text);
      }
      .auth-header .brand-copy span {
        color: var(--muted);
      }
      .side-nav {
        align-content: start;
        display: grid;
        gap: 5px;
      }
      .nav-section {
        color: var(--nav-muted);
        font-size: 11px;
        font-weight: 800;
        margin: 14px 10px 4px;
        letter-spacing: 0;
      }
      .side-nav a {
        align-items: center;
        border: 1px solid transparent;
        border-radius: var(--radius);
        color: rgba(244, 247, 251, 0.76);
        display: flex;
        gap: 10px;
        min-height: 38px;
        padding: 8px 10px;
        position: relative;
        text-decoration: none;
        font-weight: 680;
        white-space: nowrap;
        transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
      }
      .side-nav a:hover {
        background: var(--nav-panel);
        border-color: var(--nav-line);
        color: var(--nav-text);
        transform: translateX(1px);
      }
      .side-nav a.active {
        background: rgba(255, 255, 255, 0.11);
        border-color: rgba(255, 255, 255, 0.17);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0, 0, 0, 0.18);
        color: #fff;
      }
      .side-nav a.active::before {
        background: #14b8a6;
        border-radius: 999px;
        content: "";
        height: 18px;
        left: -18px;
        position: absolute;
        width: 3px;
      }
      .nav-key {
        align-items: center;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 6px;
        color: var(--nav-muted);
        display: inline-flex;
        flex: 0 0 auto;
        font-size: 11px;
        font-weight: 800;
        height: 23px;
        justify-content: center;
        width: 28px;
      }
      .side-nav a.active .nav-key {
        background: #fff;
        border-color: #fff;
        color: var(--nav-bg);
      }
      .nav-user {
        align-items: center;
        color: var(--nav-muted);
        display: inline-flex;
        font-size: 12px;
        font-weight: 700;
      }
      .sidebar-footer {
        border-top: 1px solid var(--nav-line);
        display: grid;
        gap: 8px;
        padding-top: 14px;
      }
      .nav-logout {
        margin: 0;
      }
      .nav-logout button {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--nav-line);
        color: var(--nav-text);
        font-size: 12px;
        min-height: 36px;
        padding: 8px 10px;
        width: 100%;
      }
      .app-main {
        min-width: 0;
      }
      .app-main main,
      .auth-main {
        max-width: 1320px;
        margin: 0 auto;
        padding: 28px 28px 40px;
      }
      .auth-main {
        align-items: start;
        display: grid;
        min-height: calc(100vh - 59px);
        place-content: center;
        width: 100%;
      }
      .auth-card {
        width: min(100%, 460px);
      }
      h1 { font-size: 29px; line-height: 1.12; margin: 0; }
      h2 { font-size: 17px; line-height: 1.25; margin: 0 0 14px; }
      h1, h2, strong { color: var(--text); }
      a { color: var(--accent); text-underline-offset: 3px; }
      table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        overflow: hidden;
        box-shadow: var(--shadow-tight);
      }
      th, td {
        padding: 13px 14px;
        border-bottom: 1px solid var(--line);
        vertical-align: top;
        text-align: left;
      }
      th {
        background: linear-gradient(180deg, #fbfcff, #f4f7fb);
        color: var(--muted-strong);
        font-size: 12px;
        font-weight: 800;
      }
      tr:last-child td { border-bottom: 0; }
      tbody tr:hover { background: #f8fbff; }
      .muted { color: var(--muted); }
      .metric { color: var(--good); font-weight: 800; }
      .risk-medium { color: var(--warn); font-weight: 700; }
      .risk-low { color: var(--good); font-weight: 700; }
      .stack { display: grid; gap: 16px; }
      .panel {
        background:
          linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
          var(--panel);
        border-radius: var(--radius);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
        overflow: hidden;
        padding: 18px;
        position: relative;
      }
      .panel,
      .summary-tile {
        min-width: 0;
      }
      .panel::before {
        background: linear-gradient(90deg, var(--accent), var(--teal), var(--warn));
        content: "";
        height: 3px;
        inset: 0 0 auto 0;
        opacity: 0.78;
        position: absolute;
      }
      .panel > * {
        position: relative;
      }
      .panel .page-head h1 { font-size: 20px; }
      .panel > h2 {
        align-items: center;
        border-bottom: 1px solid var(--line);
        display: flex;
        gap: 9px;
        min-height: 34px;
        padding-bottom: 11px;
      }
      .panel > h2::before {
        background: var(--accent);
        border-radius: 4px;
        content: "";
        height: 16px;
        width: 4px;
      }
      .grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        gap: 14px;
      }
      label {
        color: var(--muted-strong);
        display: grid;
        gap: 7px;
        font-size: 13px;
        font-weight: 750;
      }
      input,
      select,
      textarea {
        width: 100%;
        border-radius: var(--radius);
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.92);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
        color: var(--text);
        min-height: 40px;
        padding: 9px 11px;
        font: inherit;
        outline: none;
        transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
      }
      input[type="checkbox"] {
        accent-color: var(--accent);
        box-shadow: none;
        height: 16px;
        min-height: 0;
        padding: 0;
        width: 16px;
      }
      .ui-switch {
        align-items: center;
        color: var(--muted-strong);
        cursor: pointer;
        display: inline-flex;
        flex: 0 0 auto;
        gap: 9px;
        min-height: 38px;
        position: relative;
        user-select: none;
        width: auto;
      }
      .ui-switch--field {
        align-self: end;
        min-height: 40px;
      }
      .ui-switch--compact {
        min-height: 32px;
      }
      .ui-switch input[type="checkbox"] {
        height: 1px;
        left: 0;
        margin: 0;
        opacity: 0;
        pointer-events: none;
        position: absolute;
        top: 0;
        width: 1px;
      }
      .ui-switch-track {
        background: #d1d5db;
        border-radius: 999px;
        box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08);
        flex: 0 0 auto;
        height: 28px;
        position: relative;
        transition: background 160ms ease, box-shadow 160ms ease;
        width: 50px;
      }
      .ui-switch-track::after {
        background: #fff;
        border-radius: 999px;
        box-shadow: 0 2px 5px rgba(15, 23, 42, 0.24);
        content: "";
        height: 24px;
        left: 2px;
        position: absolute;
        top: 2px;
        transition: transform 160ms ease;
        width: 24px;
      }
      .ui-switch input[type="checkbox"]:checked + .ui-switch-track {
        background: #34c759;
        box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.18);
      }
      .ui-switch input[type="checkbox"]:checked + .ui-switch-track::after {
        transform: translateX(22px);
      }
      .ui-switch input[type="checkbox"]:focus-visible + .ui-switch-track {
        outline: 2px solid var(--accent-muted);
        outline-offset: 2px;
      }
      .ui-switch input[type="checkbox"]:disabled + .ui-switch-track {
        background: var(--line);
        box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.06);
      }
      .ui-switch input[type="checkbox"]:disabled ~ .ui-switch-text,
      .ui-switch input[type="checkbox"]:disabled + .ui-switch-track {
        cursor: not-allowed;
        opacity: 0.62;
      }
      .ui-switch-text {
        color: var(--muted-strong);
        font-size: 13px;
        font-weight: 760;
        line-height: 1.25;
      }
      .ui-switch--compact .ui-switch-track {
        height: 24px;
        width: 42px;
      }
      .ui-switch--compact .ui-switch-track::after {
        height: 20px;
        width: 20px;
      }
      .ui-switch--compact input[type="checkbox"]:checked + .ui-switch-track::after {
        transform: translateX(18px);
      }
      input[type="file"] {
        background: var(--panel-soft);
        padding: 8px;
      }
      input[readonly],
      textarea[readonly] { background: var(--panel-soft); color: var(--muted-strong); }
      input:focus,
      select:focus,
      textarea:focus {
        background: #fff;
        border-color: var(--accent-muted);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
      }
      textarea { min-height: 112px; resize: vertical; }
      button {
        align-items: center;
        border-radius: var(--radius);
        border: 1px solid var(--accent);
        background: linear-gradient(180deg, #2f6ff4, var(--accent));
        color: #fff;
        display: inline-flex;
        justify-content: center;
        min-height: 38px;
        padding: 8px 12px;
        font: inherit;
        font-weight: 760;
        cursor: pointer;
        text-decoration: none;
        transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
      }
      button:hover {
        background: linear-gradient(180deg, var(--accent), var(--accent-strong));
        border-color: var(--accent-strong);
        box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
        transform: translateY(-1px);
      }
      button.secondary {
        background: #fff;
        border-color: var(--line-strong);
        color: var(--muted-strong);
      }
      button.secondary:hover {
        background: var(--accent-soft);
        border-color: #b7ccff;
        color: var(--accent-strong);
      }
      .icon-button {
        gap: 7px;
        min-height: 32px;
        padding: 6px 9px;
      }
      .icon-button .lucide-icon,
      .lucide-icon {
        fill: none;
        flex: 0 0 auto;
        height: 16px;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2;
        width: 16px;
      }
      button:disabled,
      button:disabled:hover {
        background: var(--panel-strong);
        border-color: var(--line);
        box-shadow: none;
        color: var(--muted);
        cursor: not-allowed;
        transform: none;
      }
      .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
      .status {
        min-height: 20px;
        color: var(--muted-strong);
        font-size: 13px;
        font-weight: 680;
        margin-top: 8px;
      }
      .scan-progress {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-tight);
        display: grid;
        gap: 12px;
        margin: 12px 0 16px;
        padding: 13px;
      }
      .scan-progress[hidden] {
        display: none;
      }
      .scan-progress-head {
        align-items: center;
        display: flex;
        gap: 12px;
        justify-content: space-between;
      }
      .scan-progress-actions {
        align-items: center;
        display: flex;
        flex: 0 0 auto;
        gap: 8px;
      }
      .scan-progress-body {
        display: grid;
        gap: 12px;
      }
      .scan-progress[data-collapsed="true"] {
        gap: 0;
      }
      .scan-progress[data-collapsed="true"] .scan-progress-body {
        display: none;
      }
      .opportunity-pagination {
        align-items: center;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: space-between;
        margin-bottom: 12px;
        padding: 10px 12px;
      }
      .list-toolbar {
        align-items: end;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
        margin-bottom: 12px;
        padding: 10px 12px;
      }
      .list-search {
        align-items: end;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .list-search label {
        display: grid;
        gap: 4px;
      }
      .list-search input[type="search"] {
        min-width: min(320px, 72vw);
      }
      .list-filter-options {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }
      .list-filter-option {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 5px 9px;
      }
      .list-sort-row {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0 0 12px;
      }
      .sort-chip,
      .sortable-head {
        align-items: center;
        color: inherit;
        display: inline-flex;
        gap: 5px;
        text-decoration: none;
      }
      .sort-chip {
        border: 1px solid var(--line);
        border-radius: 999px;
        color: var(--muted-strong);
        font-size: 12px;
        font-weight: 760;
        min-height: 30px;
        padding: 5px 9px;
      }
      .sort-chip.active,
      .sortable-head.active {
        color: var(--accent-strong);
      }
      .sort-chip:hover,
      .sortable-head:hover {
        color: var(--accent-strong);
      }
      .sort-indicator {
        color: var(--accent-strong);
        font-size: 12px;
        font-weight: 900;
        min-width: 10px;
      }
      .scan-progress-title {
        display: grid;
        gap: 2px;
      }
      .scan-progress-title strong {
        font-size: 14px;
      }
      .scan-progress-track {
        background: var(--panel-strong);
        border-radius: 999px;
        height: 10px;
        overflow: hidden;
      }
      .scan-progress-bar {
        background: linear-gradient(90deg, var(--accent), var(--teal));
        height: 100%;
        transition: width 180ms ease;
        width: 0;
      }
      .scan-step-list {
        display: grid;
        gap: 8px;
        list-style: none;
        margin: 0;
        max-height: 380px;
        overflow: auto;
        padding: 0;
      }
      .scan-step {
        align-items: start;
        background: var(--panel-soft);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        display: grid;
        gap: 3px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        min-height: 44px;
        padding: 8px 10px;
      }
      .scan-step-dot {
        background: var(--line-strong);
        border-radius: 999px;
        height: 10px;
        margin-top: 7px;
        width: 10px;
      }
      .scan-step-label {
        font-weight: 780;
      }
      .scan-step-detail {
        color: var(--muted);
        font-size: 12px;
        word-break: break-word;
      }
      .scan-step-progress-track {
        background: #e7ecf5;
        border-radius: 999px;
        height: 6px;
        margin-top: 6px;
        overflow: hidden;
      }
      .scan-step-progress-bar {
        background: linear-gradient(90deg, var(--accent), var(--teal));
        height: 100%;
        transition: width 180ms ease;
        width: 0;
      }
      .scan-step-state {
        color: var(--muted-strong);
        font-size: 12px;
        font-weight: 780;
        white-space: nowrap;
      }
      .scan-step.running {
        border-color: #b7ccff;
        background: #f6faff;
      }
      .scan-step.running .scan-step-dot {
        background: var(--accent);
      }
      .scan-step.success .scan-step-dot {
        background: var(--good);
      }
      .scan-step.failed .scan-step-dot {
        background: var(--bad);
      }
      .scan-step.skipped .scan-step-dot,
      .scan-step.warn .scan-step-dot {
        background: var(--warn);
      }
      ol, ul { margin: 0; padding-left: 18px; }
      .empty {
        background:
          linear-gradient(180deg, #fff, #fbfcff);
        border-radius: var(--radius);
        border: 1px dashed var(--line-strong);
        box-shadow: var(--shadow-soft);
        padding: 22px;
      }
      .page-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 18px;
        margin-bottom: 20px;
      }
      .page-head > div:first-child {
        display: grid;
        gap: 6px;
      }
      .summary-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
        gap: 12px;
        margin-bottom: 18px;
      }
      .summary-tile {
        background:
          linear-gradient(180deg, #ffffff, #fbfcff);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        min-height: 100px;
        overflow: hidden;
        padding: 16px;
        position: relative;
      }
      .summary-tile::before {
        background: var(--accent);
        content: "";
        height: 100%;
        inset: 0 auto 0 0;
        position: absolute;
        width: 4px;
      }
      .summary-tile:nth-child(2)::before { background: var(--good); }
      .summary-tile:nth-child(3)::before { background: var(--warn); }
      .summary-tile:nth-child(4)::before { background: var(--purple); }
      .summary-tile:nth-child(5)::before { background: var(--teal); }
      .summary-tile:nth-child(6)::before { background: var(--bad); }
      .summary-value {
        display: block;
        font-size: 26px;
        font-weight: 800;
        line-height: 1.1;
      }
      .summary-label {
        color: var(--muted);
        display: block;
        font-size: 12px;
        font-weight: 700;
        margin-top: 7px;
      }
      .opportunity-list {
        display: grid;
        gap: 14px;
      }
      .opportunity-group {
        display: grid;
        gap: 12px;
      }
      .opportunity-group + .opportunity-group {
        margin-top: 6px;
      }
      .opportunity-group-head {
        border-bottom: 1px solid var(--line);
        padding-bottom: 2px;
      }
      .opportunity-card {
        display: grid;
        grid-template-columns: 92px minmax(220px, 0.85fr) minmax(320px, 1.25fr);
        gap: 16px;
        align-items: start;
        background:
          linear-gradient(180deg, #ffffff, #fbfcff);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-tight);
        overflow: hidden;
        padding: 16px;
        position: relative;
        transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
      }
      .opportunity-card::before {
        background: linear-gradient(180deg, var(--good), var(--teal));
        content: "";
        inset: 0 auto 0 0;
        position: absolute;
        width: 4px;
      }
      .opportunity-card > * {
        position: relative;
      }
      .opportunity-card:hover {
        border-color: var(--line-strong);
        box-shadow: var(--shadow);
        transform: translateY(-1px);
      }
      .item-thumb,
      .item-thumb-fallback {
        width: 76px;
        height: 76px;
        border-radius: var(--radius);
        border: 1px solid rgba(255, 255, 255, 0.14);
        background:
          linear-gradient(135deg, #252a35, #111318);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 22px rgba(17, 24, 39, 0.12);
      }
      .item-thumb {
        display: block;
        object-fit: contain;
        padding: 5px;
      }
      .item-thumb-fallback {
        display: grid;
        place-items: center;
        color: #fff;
        font-size: 22px;
        font-weight: 800;
      }
      .item-title {
        display: grid;
        gap: 5px;
      }
      .item-title-heading {
        align-items: center;
        display: flex;
        gap: 6px;
        min-width: 0;
      }
      .item-title strong {
        font-size: 16px;
      }
      .item-title-heading strong {
        min-width: 0;
      }
      .copy-name-button {
        flex: 0 0 auto;
        height: 28px;
        width: 28px;
      }
      .chips {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 9px;
      }
      .chip {
        border: 1px solid #c7d8ff;
        border-radius: 999px;
        background: var(--accent-soft);
        color: var(--accent-strong);
        display: inline-flex;
        font-size: 12px;
        font-weight: 760;
        line-height: 1.2;
        padding: 4px 8px;
      }
      .chip.warn {
        border-color: #fed7aa;
        background: var(--warn-soft);
        color: var(--warn);
      }
      .chip.good {
        background: var(--good-soft);
        border-color: #bbf7d0;
        color: var(--good);
      }
      .buy-snapshot {
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .route-line {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 8px;
        align-items: center;
      }
      .price-node {
        background: var(--panel-soft);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        min-height: 78px;
        padding: 10px;
      }
      .price-label {
        color: var(--muted);
        font-size: 12px;
        font-weight: 760;
      }
      .price-value {
        font-size: 20px;
        font-weight: 800;
      }
      .route-arrow {
        align-items: center;
        background: var(--nav-bg);
        border-radius: 999px;
        color: #fff;
        display: inline-flex;
        font-weight: 800;
        height: 26px;
        justify-content: center;
        width: 26px;
      }
      .best-buy-order {
        align-items: center;
        background: #fff;
        border: 1px solid var(--line);
        border-left: 3px solid var(--warn);
        border-radius: var(--radius);
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
        padding: 10px 10px 10px 12px;
      }
      .opportunity-market {
        border-top: 1px solid var(--line);
        display: grid;
        gap: 10px;
        grid-column: 1 / -1;
        margin-top: 2px;
        padding-top: 12px;
      }
      .opportunity-market-table th,
      .opportunity-market-table td {
        vertical-align: top;
      }
      .trend-button {
        white-space: nowrap;
      }
      .trend-modal {
        align-items: center;
        background: rgba(17, 24, 39, 0.52);
        display: flex;
        inset: 0;
        justify-content: center;
        padding: 22px;
        position: fixed;
        z-index: 100;
      }
      .trend-modal[hidden] {
        display: none;
      }
      .trend-dialog {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: 0 24px 68px rgba(17, 24, 39, 0.26);
        display: grid;
        gap: 12px;
        max-height: min(720px, calc(100vh - 44px));
        max-width: 960px;
        overflow: hidden;
        padding: 16px;
        position: relative;
        width: min(960px, 100%);
      }
      .trend-dialog-head {
        align-items: start;
        display: flex;
        gap: 12px;
        justify-content: space-between;
      }
      .trend-title {
        display: grid;
        gap: 2px;
      }
      .trend-title strong {
        font-size: 16px;
      }
      .trend-controls {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: space-between;
      }
      .segmented-control {
        background: var(--panel-soft);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        display: inline-flex;
        padding: 3px;
      }
      .segmented-control button {
        background: transparent;
        border: 0;
        color: var(--muted-strong);
        min-height: 30px;
        padding: 5px 10px;
      }
      .segmented-control button:hover {
        background: #fff;
        box-shadow: none;
        color: var(--accent-strong);
        transform: none;
      }
      .segmented-control button.active {
        background: #fff;
        box-shadow: var(--shadow-tight);
        color: var(--accent-strong);
      }
      .trend-legend {
        align-items: center;
        color: var(--muted-strong);
        display: flex;
        flex-wrap: wrap;
        font-size: 12px;
        font-weight: 720;
        gap: 12px;
      }
      .trend-legend span {
        align-items: center;
        display: inline-flex;
        gap: 5px;
      }
      .trend-legend span::before {
        background: var(--accent);
        border-radius: 999px;
        content: "";
        height: 8px;
        width: 8px;
      }
      .trend-legend span:nth-child(2)::before {
        background: var(--good);
      }
      .trend-chart-wrap {
        background:
          linear-gradient(180deg, #ffffff, var(--panel-soft));
        border: 1px solid var(--line);
        border-radius: var(--radius);
        min-height: 360px;
        overflow: hidden;
        position: relative;
      }
      .trend-chart {
        display: block;
        height: 420px;
        width: 100%;
      }
      .trend-chart .grid-line {
        stroke: #e4e9f2;
        stroke-width: 1;
      }
      .trend-chart .axis-label {
        fill: var(--muted);
        font-size: 11px;
        font-weight: 650;
      }
      .trend-chart .trend-sell {
        fill: none;
        stroke: var(--accent);
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 3;
      }
      .trend-chart .trend-buy {
        fill: none;
        stroke: var(--good);
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 3;
      }
      .trend-chart .hover-line {
        stroke: var(--muted-strong);
        stroke-dasharray: 4 4;
        stroke-width: 1.5;
      }
      .trend-chart .hover-point {
        fill: #fff;
        stroke-width: 2.5;
      }
      .trend-tooltip {
        background: rgba(17, 24, 39, 0.94);
        border-radius: var(--radius);
        color: #fff;
        display: none;
        font-size: 12px;
        line-height: 1.45;
        min-width: 170px;
        padding: 9px 10px;
        pointer-events: none;
        position: absolute;
        z-index: 2;
      }
      .trend-tooltip strong {
        display: block;
        font-size: 12px;
        margin-bottom: 4px;
      }
      .trend-empty {
        color: var(--muted);
        display: none;
        font-weight: 700;
        inset: 0;
        place-items: center;
        position: absolute;
      }
      .steps {
        display: grid;
        gap: 10px;
      }
      .steps ol {
        display: grid;
        gap: 6px;
      }
      .watch-item {
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .watch-item-name {
        display: grid;
        gap: 2px;
        min-width: 0;
      }
      .watch-item-name-row {
        align-items: center;
        display: flex;
        gap: 6px;
        min-width: 0;
      }
      .watch-item-name strong,
      .watch-item-name span {
        overflow-wrap: anywhere;
      }
      .watch-copy-button {
        flex: 0 0 auto;
        min-height: 26px;
        padding: 5px;
        width: 26px;
      }
      .watch-item .item-thumb,
      .watch-item .item-thumb-fallback {
        width: 44px;
        height: 44px;
        font-size: 14px;
      }
      .quote-section {
        background: linear-gradient(180deg, #ffffff, #fbfcff);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-tight);
        overflow: hidden;
      }
      .quote-head {
        align-items: center;
        background:
          linear-gradient(180deg, #ffffff, #f7faff);
        border-bottom: 1px solid var(--line);
        display: flex;
        gap: 12px;
        padding: 15px;
      }
      .quote-head .item-thumb,
      .quote-head .item-thumb-fallback {
        height: 54px;
        width: 54px;
        font-size: 16px;
      }
      .quote-summary {
        background: #fff;
        border-bottom: 1px solid var(--line);
        display: grid;
        gap: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 13px 15px;
      }
      .quote-summary-item {
        align-items: center;
        background: var(--panel-soft);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
      }
      .quote-note {
        background: #fff;
        border-bottom: 1px solid var(--line);
        color: var(--muted);
        padding: 0 15px 13px;
      }
      .quote-history {
        background: #fff;
        border-bottom: 1px solid var(--line);
        display: grid;
        gap: 10px;
        padding: 13px 15px;
      }
      .quote-history-head {
        align-items: center;
        display: flex;
        gap: 12px;
        justify-content: space-between;
      }
      .quote-history-grid {
        align-items: center;
        display: grid;
        gap: 12px;
        grid-template-columns: minmax(180px, 1fr) minmax(180px, 260px);
      }
      .quote-table-wrap {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      .quote-table {
        border: 0;
        border-radius: 0;
        box-shadow: none;
      }
      .quote-row-marked {
        background: #f6faff;
      }
      .quote-flags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 6px;
      }
      .quote-pill {
        border: 1px solid #bbf7d0;
        border-radius: 999px;
        background: var(--good-soft);
        color: var(--good);
        display: inline-flex;
        font-size: 12px;
        font-weight: 760;
        line-height: 1.2;
        padding: 4px 8px;
      }
      .quote-pill.warn {
        border-color: #fed7aa;
        background: var(--warn-soft);
        color: var(--warn);
      }
      .quote-link {
        border: 1px solid #bfd0ff;
        border-radius: var(--radius);
        color: var(--accent-strong);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 780;
        min-height: 32px;
        padding: 6px 9px;
        text-decoration: none;
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.72);
        transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
      }
      .quote-link:hover {
        background: var(--accent-soft);
        border-color: var(--accent-strong);
        color: var(--accent-strong);
        box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
        transform: translateY(-1px);
      }
      .quote-action {
        white-space: nowrap;
      }
      ::selection {
        background: #bfdbfe;
        color: var(--text);
      }
      @media (max-width: 980px) {
        .app-shell {
          display: block;
        }
        .sidebar {
          height: auto;
          overflow: visible;
          padding: 12px 16px;
          position: sticky;
          z-index: 12;
          border-right: 0;
          border-bottom: 1px solid var(--nav-line);
        }
        .sidebar-inner {
          gap: 10px;
          grid-template-rows: auto auto auto;
          min-height: 0;
        }
        .side-nav {
          display: flex;
          gap: 6px;
          overflow-x: auto;
          padding-bottom: 2px;
          scroll-snap-type: x proximity;
          scrollbar-width: thin;
        }
        .side-nav a {
          flex: 0 0 auto;
          scroll-snap-align: start;
        }
        .side-nav a.active::before {
          display: none;
        }
        .nav-section,
        .topbar {
          display: none;
        }
        .sidebar-footer {
          align-items: center;
          border-top: 0;
          display: flex;
          gap: 10px;
          padding-top: 0;
        }
        .nav-logout button {
          width: auto;
        }
      }
      @media (max-width: 900px) {
        .page-head {
          align-items: start;
          flex-direction: column;
        }
        .summary-grid {
          grid-template-columns: 1fr;
        }
        .opportunity-card {
          grid-template-columns: 82px minmax(0, 1fr);
        }
        .buy-snapshot,
        .route-line,
        .opportunity-market,
        .steps {
          grid-column: 1 / -1;
        }
        .quote-summary {
          grid-template-columns: 1fr;
        }
        .quote-history-head,
        .quote-history-grid {
          align-items: stretch;
          grid-template-columns: 1fr;
        }
        .trend-dialog {
          max-height: calc(100vh - 32px);
          padding: 13px;
        }
        .trend-dialog-head {
          align-items: stretch;
        }
        .trend-chart {
          height: 340px;
        }
      }
      @media (max-width: 560px) {
        .app-main main,
        .auth-main { padding: 16px; }
        .auth-card .actions > button {
          width: 100%;
        }
        .brand-copy span { display: none; }
        h1 { font-size: 24px; }
        table { font-size: 13px; }
        th, td { padding: 10px; }
        .sidebar-footer { flex-wrap: wrap; }
        .nav-logout button { width: auto; }
        .buy-snapshot,
        .route-line { grid-template-columns: 1fr; }
        .route-arrow { display: none; }
        .side-nav a {
          font-size: 12px;
          min-height: 34px;
          padding: 7px 4px;
        }
        .side-nav {
          display: grid;
          grid-template-columns: repeat(3, minmax(0, 1fr));
          overflow: visible;
          padding-bottom: 0;
          scroll-snap-type: none;
        }
        .side-nav a {
          justify-content: center;
          min-width: 0;
          overflow: hidden;
          text-align: center;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
        .nav-key {
          display: none;
        }
        .actions,
        .list-toolbar,
        .list-search,
        .opportunity-pagination,
        .inventory-pagination,
        .quote-history-head {
          align-items: stretch;
          flex-direction: column;
        }
        .actions > a,
        .actions > button,
        .list-search > button,
        .list-search > a,
        .quote-link {
          width: 100%;
        }
        .list-search input[type="search"] {
          min-width: 0;
          width: 100%;
        }
        .opportunity-card {
          grid-template-columns: 1fr;
          gap: 12px;
          padding: 13px;
        }
        .opportunity-card > div:first-child {
          align-items: center;
          display: flex;
        }
        .item-thumb,
        .item-thumb-fallback {
          height: 64px;
          width: 64px;
        }
        .item-title-heading {
          align-items: flex-start;
          flex-wrap: wrap;
        }
        .opportunity-market-table,
        .quote-table,
        table {
          display: block;
          max-width: 100%;
          overflow-x: auto;
          -webkit-overflow-scrolling: touch;
        }
        .opportunity-market-table {
          min-width: 620px;
        }
        .quote-table-wrap > table {
          display: table;
          min-width: 560px;
        }
        .quote-table-wrap > table th {
          white-space: nowrap;
        }
        .trend-modal {
          align-items: stretch;
          padding: 8px;
        }
        .trend-dialog {
          max-height: calc(100dvh - 16px);
          padding: 10px;
        }
        .trend-chart-wrap {
          min-height: 300px;
        }
        .trend-chart {
          height: 300px;
        }
      }


/* Source: featured_items.html */
  .featured-page {
    display: grid;
    gap: 16px;
  }

  .featured-toolbar {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
  }

  .featured-platform-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .featured-platform-option {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    gap: 6px;
    min-height: 36px;
    padding: 7px 10px;
  }

  .featured-price-cell {
    display: grid;
    gap: 3px;
    min-width: 118px;
  }

  .featured-price-line {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: space-between;
  }

  .featured-table-wrap {
    overflow-x: auto;
  }

  @media (max-width: 760px) {
    .featured-toolbar,
    .featured-page .actions {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      width: 100%;
    }

    .featured-page .actions button,
    .featured-page .actions select {
      width: 100%;
    }
  }


/* Source: tasks.html */
  .tasks-page {
    display: grid;
    gap: 18px;
  }

  .tasks-page .select-inline {
    align-items: center;
    display: inline-flex;
    gap: 8px;
  }

  .task-pagination {
    margin-top: 12px;
  }

  .task-inline-form {
    display: grid;
    gap: 8px;
    min-width: 150px;
  }

  .task-inline-field {
    color: var(--muted);
    display: grid;
    font-size: 0.82rem;
    gap: 4px;
  }

  .task-inline-field input {
    min-width: 0;
    width: 100%;
  }

  .listing-rule-actions {
    align-items: stretch;
    display: grid;
    gap: 8px;
    margin-top: 10px;
    min-width: 118px;
  }

  .listing-rule-actions > a,
  .listing-rule-actions > button {
    justify-content: center;
    width: 100%;
  }

  @media (max-width: 760px) {
    .tasks-page .actions {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      width: 100%;
    }

    .tasks-page .actions button,
    .tasks-page .actions .secondary,
    .tasks-page .actions a,
    .tasks-page .actions select {
      width: 100%;
    }

    .tasks-page .select-inline {
      align-items: stretch;
      display: grid;
      width: 100%;
    }

    .tasks-page .watch-item {
      align-items: flex-start;
    }
  }


/* Source: opportunities.html */
  .scan-platform-selector {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: -8px 0 14px;
  }

  .scan-platform-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .scan-platform-option {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    display: inline-flex;
    gap: 6px;
    min-height: 36px;
    padding: 7px 10px;
  }



/* Source: candidates.html */
  .candidate-page {
    display: grid;
    gap: 18px;
  }

  .candidate-pagination {
    margin-top: 12px;
  }

  .candidate-style-toolbar,
  .candidate-watchlist-toolbar {
    margin-top: 16px;
  }

  .candidate-watchlist-toolbar {
    align-items: center;
  }

  .candidate-watchlist-wrap {
    margin-top: 12px;
  }

  .candidate-watchlist-table th:first-child {
    width: 24%;
  }

  .candidate-watchlist-table th:nth-child(2) {
    width: 50%;
  }

  .candidate-watch-name {
    overflow-wrap: anywhere;
  }

  .candidate-page .select-inline {
    align-items: center;
    display: inline-flex;
    gap: 8px;
  }

  .watch-priority-control {
    align-items: center;
    display: inline-flex;
    gap: 8px;
  }

  .watch-priority-select {
    color: #b45309;
    font-weight: 800;
    min-width: 126px;
  }

  .watch-priority-stars {
    color: #b45309;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }

  .watch-style-options {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
  }

  .watch-style-cell {
    min-width: 300px;
  }

  .watch-style-summary {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
  }

  .watch-style-state,
  .watch-style-name {
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    padding: 5px 9px;
  }

  .watch-style-state-multi {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
  }

  .watch-style-state-single {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
  }

  .watch-style-state-unknown {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
  }

  .watch-style-state-conflict {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
  }

  .watch-style-name {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    overflow-wrap: anywhere;
  }

  .watch-style-empty {
    font-size: 12px;
    margin-top: 6px;
  }

  .watch-style-pill {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
  }

  .watch-style-source {
    color: #64748b;
    font-weight: 650;
  }

  .item-style-marker-slot {
    display: block;
    margin-top: 4px;
  }

  .item-multi-style-marker {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 7px;
    max-width: 100%;
  }

  .item-multi-style-badge {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #3730a3;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    padding: 2px 7px;
    white-space: nowrap;
  }

  .item-multi-style-detail {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .watch-style-editor {
    display: grid;
    gap: 8px;
  }

  .watch-style-editor-row {
    align-items: center;
    display: flex;
    gap: 8px;
  }

  .watch-style-editor-row select {
    min-width: 72px;
  }

  .watch-style-name-input {
    min-width: 220px;
    width: 100%;
  }

  .candidate-watchlist-empty {
    margin-top: 12px;
  }

  @media (max-width: 760px) {
    .candidate-page .page-head,
    .candidate-page .grid {
      gap: 12px;
    }

    .candidate-page .actions {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      width: 100%;
    }

    .candidate-page .actions button,
    .candidate-page .actions .secondary,
    .candidate-page .actions select {
      width: 100%;
    }

    .candidate-page .select-inline {
      align-items: stretch;
      display: grid;
      width: 100%;
    }

    .watch-priority-control {
      align-items: stretch;
      display: grid;
    }

    .candidate-watchlist-table th:first-child,
    .candidate-watchlist-table th:nth-child(2) {
      width: auto;
    }

    .candidate-page .watch-item-name-row {
      align-items: flex-start;
    }
  }


/* Source: buff_price_cache.html */
  .buff-order-book-dialog {
    max-width: min(960px, calc(100vw - 32px));
  }
  .buff-order-book-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 12px;
  }
  .buff-order-book-side h3 {
    font-size: 15px;
    margin: 0 0 8px;
  }
  .buff-order-book-table-wrap {
    max-height: min(420px, 56vh);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .buff-order-book-table-wrap table {
    margin: 0;
  }
  .buff-order-book-summary {
    line-height: 1.7;
  }
  .buff-rotation-controls {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }
  .buff-rotation-row {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    padding: 10px 12px;
  }
  .buff-rotation-interval {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    white-space: nowrap;
  }
  .buff-rotation-interval input {
    width: 84px;
  }
  .buff-cache-update-stats {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
  }
  .buff-cache-update-stats-head {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .buff-cache-update-stat-list {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  }
  .buff-cache-update-stat-group {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  }
  .buff-cache-update-stat-group-title {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    grid-column: 1 / -1;
  }
  .buff-cache-update-stat {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
  }
  .buff-cache-update-stat-label {
    color: var(--muted);
    display: block;
    font-size: 12px;
    line-height: 1.4;
  }
  .buff-cache-update-stat-value {
    color: var(--text);
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2px;
  }
  .buff-cache-update-stat-detail {
    align-self: center;
    grid-column: 1 / -1;
  }
  @media (max-width: 760px) {
    .buff-order-book-grid {
      grid-template-columns: 1fr;
    }
    .buff-rotation-row {
      grid-template-columns: auto minmax(0, 1fr);
    }
    .buff-rotation-interval {
      grid-column: 1 / -1;
    }
  }


/* Source: holding_costs.html */
  .holding-cost-page {
    display: grid;
    gap: 18px;
  }
  .holding-cost-toolbar {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
  }
  .holding-cost-filters {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .holding-cost-filters input[type="search"] {
    min-width: min(360px, 78vw);
  }
  .holding-cost-filters select {
    min-width: 150px;
  }
  .holding-cost-filters input[type="number"] {
    min-width: 110px;
  }
  .holding-cost-tabs {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
  }
  .holding-cost-manual-help {
    align-items: start;
    background: var(--accent-soft);
    border: 1px solid #b7ccff;
    border-radius: 10px;
    color: var(--muted-strong);
    display: grid;
    gap: 3px;
    margin-bottom: 12px;
    padding: 10px 12px;
  }
  .holding-cost-manual-help strong {
    color: var(--accent-strong);
    font-size: 13px;
  }
  .holding-cost-tab {
    align-items: start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted-strong);
    display: grid;
    flex: 0 0 auto;
    gap: 3px;
    min-width: 190px;
    padding: 9px 11px;
    text-align: left;
  }
  .holding-cost-tab strong {
    color: var(--text);
    font-size: 13px;
  }
  .holding-cost-tab span {
    font-size: 12px;
    line-height: 1.35;
  }
  .holding-cost-tab[aria-selected="true"] {
    background: #eef6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
  }
  .holding-cost-check {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    margin: 0;
    min-height: 40px;
  }
  .holding-cost-accounts {
    display: grid;
    gap: 16px;
  }
  .holding-cost-pagination {
    margin: 12px 0;
  }
  .holding-cost-pagination label {
    align-items: center;
    display: inline-flex;
    gap: 6px;
  }
  .holding-cost-pagination select {
    width: 84px;
  }
  .holding-account {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-tight);
    overflow: hidden;
  }
  .holding-account-head {
    align-items: center;
    background: linear-gradient(180deg, #fff, #f8fafc);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 13px 14px;
  }
  .holding-account-title {
    display: grid;
    gap: 3px;
    min-width: 0;
  }
  .holding-account-title strong {
    font-size: 15px;
  }
  .holding-account-stats {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }
  .holding-cost-table-wrap {
    overflow: auto;
  }
  .holding-cost-table {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-width: 1420px;
  }
  .holding-cost-table th:nth-child(6),
  .holding-cost-table td:nth-child(6) {
    min-width: 230px;
  }
  .holding-cost-table th,
  .holding-cost-table td {
    padding: 11px 12px;
  }
  .holding-item {
    align-items: start;
    display: grid;
    gap: 10px;
    grid-template-columns: 52px minmax(190px, 1fr);
  }
  .holding-thumb,
  .holding-thumb-fallback {
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 1px solid var(--line);
    border-radius: 7px;
    height: 48px;
    width: 48px;
  }
  .holding-thumb {
    object-fit: contain;
    padding: 4px;
  }
  .holding-thumb-fallback {
    color: #fff;
    display: grid;
    font-size: 15px;
    font-weight: 800;
    place-items: center;
  }
  .holding-item-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
  }
  .holding-item-copy strong {
    overflow-wrap: anywhere;
  }
  .holding-meta {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .holding-cost-value {
    display: grid;
    gap: 5px;
    min-width: 120px;
  }
  .holding-cost-price {
    font-size: 16px;
    font-weight: 850;
  }
  .holding-cost-manual-action {
    margin-top: 3px;
    white-space: nowrap;
    width: max-content;
  }
  .holding-badge {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-strong);
    display: inline-flex;
    font-size: 12px;
    font-weight: 780;
    min-height: 24px;
    padding: 3px 8px;
    width: max-content;
  }
  .holding-badge.good {
    background: var(--good-soft);
    border-color: #b7ead4;
    color: var(--good);
  }
  .holding-badge.warn {
    background: var(--warn-soft);
    border-color: #f1d694;
    color: var(--warn);
  }
  .holding-badge.bad {
    background: var(--bad-soft);
    border-color: #ffc4c0;
    color: var(--bad);
  }
  .holding-source-list {
    display: grid;
    gap: 6px;
    min-width: 220px;
  }
  .holding-source-line {
    border-left: 3px solid var(--line-strong);
    display: grid;
    gap: 2px;
    padding-left: 8px;
  }
  .holding-source-line strong {
    font-size: 12px;
  }
  .holding-source-line span {
    color: var(--muted-strong);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .holding-empty {
    padding: 18px;
  }
  .holding-cost-dialog-backdrop {
    background: rgba(17, 24, 39, 0.42);
    display: grid;
    inset: 0;
    padding: 18px;
    place-items: center;
    position: fixed;
    z-index: 40;
  }
  .holding-cost-dialog-backdrop[hidden] {
    display: none;
  }
  .holding-cost-dialog {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
    max-width: 520px;
    padding: 18px;
    width: min(100%, 520px);
  }
  .holding-cost-dialog h2 {
    margin: 0;
  }
  .holding-cost-dialog-context {
    background: var(--panel-soft, #f8fafc);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 12px;
  }
  .holding-cost-dialog-context > div {
    display: grid;
    gap: 2px;
    grid-template-columns: minmax(100px, 0.35fr) minmax(0, 1fr);
  }
  .holding-cost-dialog-context dt {
    color: var(--muted-strong);
    font-size: 12px;
  }
  .holding-cost-dialog-context dd {
    margin: 0;
    overflow-wrap: anywhere;
  }
  .holding-cost-dialog-confirm {
    align-items: flex-start;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 10px;
    display: flex;
    gap: 9px;
    padding: 10px 12px;
  }
  .holding-cost-dialog-confirm input {
    flex: 0 0 auto;
    margin-top: 3px;
  }
  .holding-cost-dialog-confirm span {
    line-height: 1.45;
  }
  .holding-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
  }
  @media (max-width: 760px) {
    .holding-cost-toolbar {
      align-items: stretch;
    }
    .holding-cost-filters,
    .holding-cost-toolbar .actions {
      width: 100%;
    }
    .holding-cost-toolbar .actions button,
    .holding-cost-toolbar .actions a {
      flex: 1 1 auto;
    }
  }


/* Source: automation_lab.html */
  .automation-lab-page {
    display: grid;
    gap: 18px;
  }
  .automation-workbench,
  .buy-request-task,
  .buy-request-strategy,
  .automation-tab-panel,
  .automation-queue-card {
    display: grid;
    gap: 14px;
  }
  .automation-tab-list {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .automation-tab-button {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted-strong);
    cursor: pointer;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    min-height: 52px;
    padding: 10px 12px;
    text-align: left;
  }
  .automation-tab-button span {
    font-weight: 760;
  }
  .automation-tab-button small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    white-space: nowrap;
  }
  .automation-tab-button[aria-selected="true"] {
    background: var(--accent-soft);
    border-color: var(--accent-muted);
    color: var(--accent-strong);
  }
  .automation-platform-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .automation-platform-tab {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted-strong);
    display: inline-flex;
    gap: 8px;
    justify-content: space-between;
    min-height: 38px;
    min-width: 128px;
    padding: 8px 10px;
    text-decoration: none;
  }
  button.automation-platform-tab {
    cursor: pointer;
    font: inherit;
    text-align: left;
  }
  .automation-platform-tab strong {
    color: inherit;
  }
  .automation-platform-tab small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    white-space: nowrap;
  }
  .automation-platform-tab[aria-selected="true"] {
    background: var(--accent-soft);
    border-color: var(--accent-muted);
    color: var(--accent-strong);
  }
  .automation-steam-tabs {
    border-left: 2px solid var(--line);
    padding-left: 10px;
  }
  .automation-steam-tab {
    min-width: 220px;
  }
  .automation-tab-summary,
  .buy-request-task,
  .buy-request-strategy,
  .automation-queue-card {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
  }
  .automation-tab-summary {
    align-items: start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }
  .automation-tab-copy {
    display: grid;
    gap: 4px;
  }
  .automation-tab-copy strong {
    font-size: 16px;
  }
  .automation-tab-chips,
  .buy-request-actions,
  .buy-request-row-action,
  .platform-status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .buy-request-row-action {
    align-items: center;
    gap: 8px;
  }
  .inline-field {
    align-items: center;
    display: flex;
    gap: 8px;
    min-height: 36px;
  }
  .inline-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    white-space: nowrap;
  }
  .inline-field input {
    min-width: 96px;
    width: 120px;
  }
  .automation-mini-button {
    min-height: 32px;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .buff-year-trend-button {
    min-width: 112px;
    text-align: center;
  }
  .buff-year-trend-button-empty {
    background: var(--panel-soft);
    border-color: var(--line);
    color: var(--muted-strong);
  }
  .buff-year-trend-dialog {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 24px 68px rgba(17, 24, 39, 0.26);
    display: grid;
    gap: 14px;
    max-height: min(640px, calc(100vh - 44px));
    max-width: 680px;
    overflow: auto;
    padding: 16px;
    width: min(680px, 100%);
  }
  .buff-year-trend-chart {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), #fff);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-height: 238px;
    padding: 10px;
  }
  .buff-year-trend-chart svg {
    display: block;
    height: 220px;
    width: 100%;
  }
  .buff-year-trend-empty {
    align-items: center;
    display: flex;
    min-height: 170px;
  }
  .buff-year-trend-meta {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .buff-year-trend-meta div {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: grid;
    gap: 3px;
    padding: 10px;
  }
  .buff-year-trend-meta span {
    color: var(--muted);
    font-size: 12px;
  }
  .buy-request-action-status {
    min-width: 110px;
  }
  .buy-request-account-dialog {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 24px 68px rgba(17, 24, 39, 0.26);
    display: grid;
    gap: 14px;
    max-width: 520px;
    padding: 16px;
    width: min(520px, 100%);
  }
  .buy-request-account-form {
    display: grid;
    gap: 10px;
  }
  .buy-request-account-native-select {
    display: none;
  }
  .buy-request-account-option-list {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: grid;
    overflow: hidden;
  }
  .buy-request-account-option {
    align-items: center;
    background: #fff;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 24px;
    min-height: 48px;
    padding: 11px 12px;
    text-align: left;
  }
  .buy-request-account-option:last-child {
    border-bottom: 0;
  }
  .buy-request-account-option:hover,
  .buy-request-account-option:focus-visible {
    background: var(--panel-soft);
    outline: none;
  }
  .buy-request-account-option.is-selected {
    background: #f5faff;
  }
  .buy-request-account-option-label {
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .buy-request-account-check {
    height: 22px;
    position: relative;
    width: 22px;
  }
  .buy-request-account-option.is-selected .buy-request-account-check::after {
    border: solid #0a84ff;
    border-width: 0 2px 2px 0;
    content: "";
    height: 13px;
    left: 8px;
    position: absolute;
    top: 1px;
    transform: rotate(45deg);
    width: 7px;
  }
  .buy-request-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
  }
  .buy-request-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(170px, 0.8fr) minmax(150px, 190px) minmax(150px, 190px) minmax(190px, 0.9fr) auto auto;
  }
  .buy-request-field {
    display: grid;
    gap: 6px;
  }
  .buy-request-field--wide {
    grid-column: 1 / -1;
  }
  .buy-request-field label {
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 760;
  }
  .buy-request-field-label {
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 760;
  }
  .buy-request-field input[type="number"],
  .buy-request-field input[type="search"],
  .buy-request-field select,
  .buy-request-field textarea {
    min-height: 42px;
  }
  .buy-request-field textarea {
    resize: vertical;
  }
  .relist-whitelist-picker {
    display: grid;
    gap: 8px;
  }
  .relist-whitelist-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .relist-whitelist-entry {
    align-items: center;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: inline-flex;
    gap: 9px;
    max-width: 100%;
    min-height: 40px;
    padding: 6px 7px 6px 10px;
  }
  .relist-whitelist-entry-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
  }
  .relist-whitelist-entry-copy > span {
    color: var(--text);
    font-size: 13px;
    font-weight: 720;
    overflow-wrap: anywhere;
  }
  .relist-whitelist-entry-copy small {
    color: var(--muted);
    font-size: 11px;
  }
  .relist-whitelist-remove {
    background: transparent;
    border: 0;
    color: var(--danger, #b42318);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    padding: 4px 5px;
  }
  .relist-whitelist-remove:disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }
  .relist-whitelist-empty {
    align-items: center;
    display: inline-flex;
    min-height: 40px;
  }
  .relist-whitelist-search-shell {
    position: relative;
  }
  .relist-whitelist-search-shell > input[type="search"] {
    width: 100%;
  }
  .relist-whitelist-options {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgb(15 23 42 / 14%);
    left: 0;
    max-height: 320px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    z-index: 30;
  }
  .relist-whitelist-options[hidden] {
    display: none;
  }
  .relist-whitelist-option {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 2px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
  }
  .relist-whitelist-option:last-child {
    border-bottom: 0;
  }
  .relist-whitelist-option:hover,
  .relist-whitelist-option:focus-visible {
    background: var(--panel-soft);
    outline: none;
  }
  .relist-whitelist-option:disabled {
    cursor: not-allowed;
    opacity: 0.55;
  }
  .relist-whitelist-option-name {
    font-size: 13px;
    font-weight: 720;
  }
  .relist-whitelist-option small {
    color: var(--muted);
    font-size: 11px;
  }
  .relist-whitelist-option-message {
    padding: 11px 12px;
  }
  .buy-request-target-note {
    grid-column: 1 / -1;
  }
  .automation-account-list,
  .buff-relist-account-list {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    min-height: 42px;
  }
  .automation-account-option,
  .buff-relist-account-option {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 9px 5px 7px;
  }
  .automation-account-option--unavailable {
    border-style: dashed;
    opacity: 0.72;
  }
  .buy-request-status {
    color: var(--muted);
    font-size: 12px;
    min-height: 18px;
  }
  .sell-listing-refresh-progress {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: grid;
    gap: 10px;
    max-width: none;
    order: 2;
    padding: 12px;
  }
  .sell-listing-refresh-progress[hidden] {
    display: none;
  }
  .sell-listing-refresh-progress-head {
    align-items: center;
    color: var(--muted-strong);
    display: flex;
    font-size: 12px;
    justify-content: space-between;
  }
  .sell-listing-refresh-progress-head > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  [data-sell-listing-order-panel] > .page-head {
    order: 0;
  }
  .sell-relist-overview {
    background: var(--panel);
    order: 1;
  }
  .sell-relist-overview-grid,
  .sell-relist-risk-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sell-relist-overview-grid > div,
  .sell-relist-risk-summary > div {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 12px;
  }
  .sell-relist-overview-grid span,
  .sell-relist-risk-summary span {
    color: var(--muted);
    font-size: 12px;
  }
  .sell-relist-overview-grid strong,
  .sell-relist-risk-summary strong {
    color: var(--ink);
    font-size: 17px;
    overflow-wrap: anywhere;
  }
  .sell-relist-overview-grid small,
  .sell-relist-risk-summary small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }
  .sell-relist-risk-summary > div.warn {
    background: var(--warn-soft);
    border-color: #fed7aa;
  }
  .sell-relist-risk-summary > div.warn strong {
    color: var(--warn);
  }
  .sell-relist-risk-summary > div.bad {
    background: var(--bad-soft);
    border-color: #fecaca;
  }
  .sell-relist-risk-summary > div.bad strong {
    color: var(--bad);
  }
  .sell-relist-health-alert {
    align-items: start;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted-strong);
    display: grid;
    font-size: 12px;
    gap: 4px;
    grid-template-columns: auto minmax(0, 1fr);
    line-height: 1.5;
    padding: 10px 12px;
  }
  .sell-relist-health-alert[hidden] {
    display: none;
  }
  .sell-relist-health-alert.warn {
    background: var(--warn-soft);
    border-color: #fed7aa;
    color: var(--warn);
  }
  .sell-relist-settings {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    order: 4;
    padding: 12px;
  }
  .sell-relist-settings-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
  }
  .sell-relist-settings-head > div {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
  }
  .sell-relist-statistics {
    background: var(--panel);
    order: 3;
  }
  .sell-relist-progress-message {
    flex: 1 0 100%;
    font-weight: 700;
  }
  .sell-relist-risk-summary {
    border-top: 1px solid var(--line);
    margin-top: 12px;
    padding-top: 12px;
  }
  .sell-relist-events {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
  }
  .sell-relist-event-list {
    max-height: 220px;
  }
  .sell-relist-event-list li {
    grid-template-columns: 145px minmax(0, 1fr);
  }
  .sell-listing-refresh-progress-track {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
  }
  .sell-listing-refresh-progress-track span {
    background: var(--accent);
    display: block;
    height: 100%;
    transition: width 180ms ease;
    width: 0%;
  }
  .automation-interface-timing {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
  }
  .automation-interface-timing summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 8px;
    justify-content: space-between;
  }
  .automation-interface-timing-list {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
  }
  .automation-interface-timing-list li {
    align-items: center;
    color: var(--muted-strong);
    display: grid;
    font-size: 12px;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    list-style: none;
  }
  .automation-interface-timing-url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .buy-request-progress {
    display: grid;
    gap: 8px;
  }
  .buy-request-progress-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }
  .buy-request-progress-track {
    background: var(--panel-strong);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
  }
  .buy-request-progress-bar {
    background: var(--accent);
    border-radius: inherit;
    height: 100%;
    transition: width 180ms ease;
    width: 0;
  }
  .buy-request-progress-meta {
    color: var(--muted-strong);
    font-size: 12px;
  }
  .buy-request-bulk-progress {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
  }
  .buy-request-reprice-progress {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
  }
  .buy-request-bulk-progress-meta,
  .buy-request-reprice-progress-meta {
    color: var(--muted-strong);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 8px 16px;
    justify-content: space-between;
  }
  .buy-request-log {
    display: grid;
    gap: 6px;
    margin: 0;
    max-height: 180px;
    overflow: auto;
    padding: 0;
  }
  .buy-request-log li {
    align-items: start;
    color: var(--muted-strong);
    display: grid;
    font-size: 12px;
    gap: 3px;
    grid-template-columns: 70px 1fr;
    list-style: none;
  }
  .buy-request-log-time {
    color: var(--muted);
  }
  .buy-request-log-level-warn {
    color: var(--warn);
  }
  .buy-request-log-level-error {
    color: var(--bad);
  }
  .automation-queue-grid {
    display: grid;
    gap: 12px;
  }
  .automation-queue-grid {
    grid-template-columns: minmax(240px, 0.75fr) minmax(420px, 1.5fr);
  }
  .automation-queue-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }
  .price-range-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .price-range-summary div {
    display: grid;
    gap: 4px;
  }
  .price-range-summary span,
  .price-range-factor-list span {
    color: var(--muted);
    font-size: 12px;
  }
  .price-range-summary small {
    color: var(--muted);
    font-size: 12px;
  }
  .price-range-summary strong {
    font-size: 18px;
  }
  .price-range-factor-list {
    display: grid;
    gap: 8px;
  }
  .price-range-factor-row {
    align-items: start;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: 110px 92px 1fr;
    padding-top: 8px;
  }
  .price-range-factor-row strong {
    color: var(--muted-strong);
  }
  .price-range-factor-detail {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }
  .price-range-factor-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
  }
  .automation-module-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
  }
  .automation-module-list li {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    list-style: none;
  }
  .automation-mini-table {
    table-layout: fixed;
    width: 100%;
  }
  .automation-mini-table th {
    white-space: normal;
  }
  .automation-mini-table th,
  .automation-mini-table td {
    font-size: 12px;
    line-height: 1.3;
    padding: 6px 8px;
    vertical-align: top;
  }
  .automation-daily-statistics-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .automation-daily-range {
    flex: 0 0 auto;
  }
  .automation-daily-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .automation-daily-calendar-shell {
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .automation-daily-weekdays,
  .automation-daily-calendar {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(7, minmax(82px, 1fr));
    min-width: 690px;
  }
  .automation-daily-weekdays {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    margin-bottom: 7px;
    text-align: center;
  }
  .automation-daily-day {
    align-content: start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    cursor: pointer;
    display: grid;
    gap: 6px;
    min-height: 94px;
    padding: 9px;
    text-align: left;
  }
  .automation-daily-day:hover {
    border-color: var(--accent-muted);
  }
  .automation-daily-day.has-data {
    background: var(--accent-soft);
  }
  .automation-daily-day.is-today .automation-daily-day-date::after {
    color: var(--accent-strong);
    content: " · 今天";
  }
  .automation-daily-day.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
  }
  .automation-daily-day-date,
  .automation-daily-day small {
    color: var(--muted);
    font-size: 12px;
  }
  .automation-daily-day strong {
    font-size: 16px;
  }
  .automation-daily-calendar-spacer {
    min-height: 1px;
  }
  .automation-daily-tier-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }
  .automation-daily-tier-table {
    min-width: 520px;
  }
  .automation-daily-note {
    padding: 10px 12px;
  }
  .automation-daily-status {
    min-height: 18px;
  }
  .buy-request-wide-table {
    min-width: 1420px;
  }
  .buy-request-wide-table th:first-child,
  .buy-request-wide-table td:first-child {
    width: 230px;
  }
  .automation-priority-cell {
    min-width: 78px;
    width: 78px;
  }
  .automation-priority-stars {
    color: var(--warn);
    display: block;
    font-size: 13px;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .buy-request-book-col {
    min-width: 96px;
    width: 96px;
  }
  .buy-request-volume-col {
    min-width: 82px;
    width: 82px;
  }
  .buy-request-item {
    align-items: flex-start;
    display: flex;
    gap: 7px;
    min-width: 0;
  }
  .buy-request-item .item-thumb {
    flex: 0 0 auto;
    height: 34px;
    padding: 2px;
    width: 34px;
  }
  .buy-request-item .item-thumb img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
  }
  .buy-request-item .item-thumb span {
    align-items: center;
    color: #fff;
    display: flex;
    font-size: 11px;
    font-weight: 800;
    height: 100%;
    justify-content: center;
  }
  .buy-request-item strong {
    font-size: 12px;
  }
  .buy-request-item .muted {
    font-size: 11px;
  }
  .automation-item-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
  }
  .automation-item-name-row {
    align-items: center;
    display: flex;
    gap: 5px;
    min-width: 0;
  }
  .automation-item-copy-button {
    flex: 0 0 auto;
    min-height: 24px;
    padding: 4px;
    width: 24px;
  }
  .automation-item-copy-button .lucide-icon {
    height: 14px;
    width: 14px;
  }
  .automation-text-clip,
  .automation-item-name,
  .automation-item-meta {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
  }
  .automation-reason {
    max-width: 260px;
  }
  .order-book-levels {
    display: grid;
    gap: 2px;
    margin-top: 3px;
  }
  .order-book-level {
    color: var(--muted-strong);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .buy-request-platform-list {
    display: grid;
    gap: 14px;
  }
  .buy-request-platform-section {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 8px;
    padding-top: 10px;
  }
  .buy-request-pagination {
    margin: 0;
    padding: 8px 10px;
  }
  .buy-request-page-size-options {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .automation-empty {
    background: var(--panel-soft);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    padding: 16px;
  }
  @media (max-width: 1180px) {
    .automation-tab-list,
    .automation-queue-grid,
    .price-range-summary,
    .buy-request-form,
    .sell-relist-overview-grid,
    .sell-relist-risk-summary {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (max-width: 640px) {
    .automation-tab-list,
    .automation-queue-grid,
    .price-range-summary,
    .price-range-factor-row,
    .buy-request-form,
    .automation-tab-summary,
    .sell-relist-overview-grid,
    .sell-relist-risk-summary {
      display: grid;
      grid-template-columns: 1fr;
    }
    .sell-relist-health-alert {
      grid-template-columns: 1fr;
    }
    .sell-relist-event-list li {
      grid-template-columns: 1fr;
    }
    .actions,
    .buy-request-actions {
      align-items: stretch;
      display: grid;
      grid-template-columns: 1fr;
    }
    .actions > *,
    .buy-request-actions > * {
      width: 100%;
    }
    .buff-year-trend-dialog {
      max-height: calc(100dvh - 16px);
      padding: 12px;
    }
    .buff-year-trend-meta {
      grid-template-columns: 1fr;
    }
  }
