    /* ==========================================================================
       Right Panel: Available Equipment & Sidekick
       ========================================================================== */
    .section-title {
      font-size: 13px;
      font-weight: 700;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      color: var(--text-main);
    }

    .equipment-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(var(--sidekick-candidate-min-width), 1fr));
      gap: 6px;
      max-height: 280px;
      overflow-y: auto;
      padding: 2px;
    }

    .equipment-item {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 8px;
      cursor: pointer;
      transition: all 0.12s ease;
      font-size: 11px;
    }
    .equipment-item:hover {
      background: var(--bg-card-hover);
      border-color: var(--text-muted);
    }
    .equipment-item.selected {
      background: var(--bg-card-selected);
      border-color: var(--border-highlight);
      box-shadow: 0 0 0 1px var(--border-highlight);
    }
    .equipment-item.assigned > *:not(.cond-memo):not(.eq-assign-row):not(.badge-assigned):not(:has(.badge-assigned)) {
      opacity: 0.55;
    }
    .equipment-item.assigned .badge-assigned {
      opacity: 1;
    }
    .eq-no {
      font-weight: 700;
      color: var(--text-main);
      font-size: 12px;
    }
    .eq-no-btn {
      background: none;
      border: none;
      padding: 0;
      margin: 0;
      cursor: pointer;
      text-align: left;
      text-decoration: underline;
      text-decoration-style: dotted;
      text-underline-offset: 2px;
      font: inherit;
      color: inherit;
    }
    .eq-no-btn:hover, .eq-no-btn:focus-visible {
      color: var(--info);
      text-decoration-style: solid;
      outline: none;
    }
    .eq-model {
      color: var(--accent);
      font-size: 11px;
      margin-top: 2px;
    }
    .eq-meta {
      font-size: 10px;
      color: var(--text-subtle);
      margin-top: 3px;
      display: flex;
      justify-content: space-between;
    }

    /* Sidekick Panel */
    .sidekick-panel {
      background: var(--bg-inset);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .sidekick-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .sidekick-stats {
      display: flex;
      gap: 12px;
      font-size: 11px;
      color: var(--text-muted);
      background: var(--bg-inset);
      padding: 6px 10px;
      border-radius: var(--radius-sm);
      flex-wrap: wrap;
    }
    .history-record-list {
      display: flex;
      flex-direction: column;
      gap: 5px;
      max-height: 180px;
      overflow-y: auto;
    }
    .history-card {
      width: 100%;
      appearance: none;
      -webkit-appearance: none;
      text-align: left;
      color: inherit;
      cursor: pointer;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 8px 10px;
      font-size: 11px;
      display: block;
      transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
    }
    .history-card:hover {
      transform: translateY(-1px);
      border-color: var(--info-border);
      background: var(--bg-card-hover);
      box-shadow: var(--shadow);
    }
    .history-card:active {
      transform: translateY(0);
      box-shadow: none;
    }
    .history-card:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    .history-card-top {
      display: flex;
      justify-content: space-between;
      color: var(--text-muted);
      font-size: 10px;
      margin-bottom: 3px;
    }
    .history-card-title {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      font-weight: 600;
      color: var(--text-main);
      line-height: 1.35;
    }
    .history-card-title-text {
      flex: 1;
      min-width: 0;
    }
    .history-card-affordance {
      flex: 0 0 auto;
      color: var(--info);
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
    }
    .history-card-notes {
      font-size: 10px;
      color: var(--text-subtle);
      margin-top: 4px;
      line-height: 1.4;
    }

    /* Spec Class Matching & Upgrade Alternative Styles */
    .category-section-title {
      grid-column: 1 / -1;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 8px;
      border-radius: var(--radius-sm);
      font-size: 11px;
      font-weight: 700;
      margin-top: 6px;
      margin-bottom: 2px;
    }
    .category-section-title.exact-title {
      background: var(--success-bg);
      border-left: 3px solid var(--success);
      color: var(--success);
    }
    .category-section-title.upgrade-title {
      background: var(--indigo-bg);
      border-left: 3px solid var(--indigo);
      color: var(--indigo);
    }
    .badge-upgrade {
      background: var(--indigo-bg);
      color: var(--indigo);
      border: 1px solid var(--indigo-border);
    }
    .equipment-item.exact {
      border-color: var(--success-border);
    }
    .equipment-item.upgrade {
      border-color: var(--indigo-border);
      background: var(--indigo-bg);
    }
    .equipment-item.upgrade:hover {
      border-color: var(--indigo);
    }
    .upgrade-tag {
      font-size: 9px;
      color: var(--indigo);
      background: var(--indigo-bg);
      padding: 1px 4px;
      border-radius: 3px;
      margin-top: 2px;
      display: inline-block;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }
    .stock-alert-banner {
      background: var(--warning-bg);
      border: 1px solid var(--warning-border);
      border-radius: var(--radius-sm);
      padding: 7px 10px;
      margin-bottom: 8px;
      font-size: 11px;
      color: var(--warning);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    /* Equipment Header Actions & Toggle Upgrade Control */
    .equipment-header-actions {
      display: flex;
      gap: 6px;
      align-items: center;
      flex-wrap: wrap;
    }
    .toggle-upgrade-control {
      font-size: 11px;
      font-weight: 600;
      color: var(--indigo);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 2px 8px;
      border-radius: var(--radius-sm);
      background: var(--indigo-bg);
      border: 1px solid var(--indigo-border);
      transition: all 0.15s ease;
      user-select: none;
    }
    .toggle-upgrade-control:hover:not(.disabled) {
      background: var(--indigo-bg);
      border-color: var(--indigo-border);
      color: var(--indigo);
    }
    .toggle-upgrade-control.active {
      background: var(--indigo-bg);
      border-color: var(--indigo);
      color: var(--indigo);
      box-shadow: var(--shadow);
    }
    .toggle-upgrade-control.disabled {
      opacity: 0.5;
      cursor: not-allowed;
      border-color: var(--border);
      color: var(--text-muted);
      background: var(--bg-inset);
    }
    .toggle-upgrade-control input[type="checkbox"] {
      cursor: pointer;
      accent-color: var(--accent);
      width: 13px;
      height: 13px;
      margin: 0;
    }
    .toggle-upgrade-control.disabled input[type="checkbox"] {
      cursor: not-allowed;
    }

    /* Upcoming Returns Styles in Sidekick */
    .sidekick-returns-section {
      background: var(--bg-card);
      border: 1px solid var(--warning-border);
      border-radius: var(--radius-sm);
      padding: 10px;
    }
    .sidekick-returns-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      width: 100%;
      margin-bottom: 8px;
    }
    .sidekick-returns-title {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 12px;
      font-weight: 700;
      color: var(--warning);
    }
    .sidekick-returns-header-meta {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex: 0 0 auto;
    }
    .sidekick-returns-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-height: 160px;
      overflow-y: auto;
    }
    .sidekick-returns-button {
      display: none;
      align-items: center;
      justify-content: center;
      min-height: 44px;
      padding: 4px 10px;
      border: 1px solid var(--warning-border);
      border-radius: var(--radius-sm);
      background: var(--warning-bg);
      color: var(--warning);
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
    }
    .sidekick-returns-button:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    .stock-alert-returns-link {
      min-height: 32px;
      padding: 4px 2px;
      border: 0;
      background: transparent;
      color: var(--warning);
      font: inherit;
      text-decoration: underline;
      cursor: pointer;
    }
    .upcoming-return-card {
      background: var(--bg-inset);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 7px 9px;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .upcoming-return-card:hover {
      background: var(--bg-card);
      border-color: var(--warning);
      transform: translateY(-1px);
    }
    .upcoming-return-card.timeframe-highlight {
      border-color: var(--warning-border);
      background: var(--warning-bg);
      box-shadow: var(--shadow);
    }
    .upcoming-return-card.overdue-card {
      border-color: var(--border);
      background: var(--bg-inset);
    }
    .upcoming-return-card.overdue-card:hover {
      border-color: var(--text-muted);
      background: var(--bg-card);
    }

    /* Assignment / Reservation Box */
    .assignment-box {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .form-group {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .form-label {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 600;
    }
    .form-input, .form-control {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-main);
      padding: 6px 10px;
      font-size: 12px;
      outline: none;
    }
    .form-input:focus, .form-control:focus { border-color: var(--border-highlight); }
    .form-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 4px;
    }

    /* Undated Section */
    .undated-section {
      margin-top: 8px;
      border-top: 1px dashed var(--border);
      padding-top: 8px;
    }
    .undated-header {
      font-size: 11px;
      font-weight: 700;
      color: var(--warning);
      display: flex;
      align-items: center;
      gap: 4px;
      margin-bottom: 6px;
    }

    .empty-state {
      text-align: center;
      padding: 24px 12px;
      color: var(--text-subtle);
      font-size: 12px;
    }
    .spinner {
      display: inline-block;
      width: 12px;
      height: 12px;
      border: 2px solid var(--border);
      border-radius: 50%;
      border-top-color: var(--accent);
      animation: spin 0.8s linear infinite;
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Toast Container */
    #toastContainer {
      position: fixed;
      top: calc(16px + env(safe-area-inset-top, 0px));
      left: 50%;
      transform: translateX(-50%);
      z-index: 9999;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      pointer-events: none;
      width: max-content;
      max-width: calc(100vw - 32px);
    }
    .toast {
      padding: 9px 14px;
      border-radius: var(--radius-sm);
      font-size: 12px;
      box-shadow: var(--shadow);
      display: flex;
      align-items: center;
      gap: 6px;
      pointer-events: auto;
      max-width: min(360px, calc(100vw - 32px));
      word-break: break-word;
    }
    .toast-info { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border); }
    .toast-success { background: var(--bg-card); color: var(--success); border: 1px solid var(--success-border); }
    .toast-error { background: var(--bg-card); color: var(--danger-fg); border: 1px solid var(--danger-border); }

