/*
  Auction House item panel: the game's item info window (ItemInfo.css in the
  client) in a column beside the listing. The tokens are the client's dark
  preset so the two windows match. Everything is scoped under .rcp-iteminfo;
  the markup is built by js/item-panel.js into .rcp-itemlist-side.
*/

/* Page layout: list on the left, item column on the right */
.rcp-itemlist-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.rcp-itemlist-main {
  flex: 1 1 auto;
  min-width: 0;
}
/* The column itself only reserves the width; its content floats at the
   vertical centre of the viewport, kept over the column and never above the
   top of the list row (so it cannot cover the cards above) by the script. */
.rcp-itemlist-side {
  flex: 0 0 320px;
  width: 320px;
  min-height: 1px;
  align-self: flex-start;
}
.rcp-itemlist-side-inner {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 320px;
  max-height: var(--rcp-panel-max, calc(100vh - 28px));
  display: flex;
  flex-direction: column;
  visibility: hidden;
}
.rcp-itemlist-side-inner.is-placed { visibility: visible; }
.rcp-itemlist-side-empty {
  min-height: 120px;
  margin: 0;
}
.rcp-table > tbody > tr.rcp-row-clickable { cursor: pointer; }
.rcp-table > tbody > tr.rcp-row-clickable:hover > td {
  background-color: rgba(142, 197, 255, 0.07);
}
.rcp-table > tbody > tr.rcp-row-selected > td {
  background-color: rgba(142, 197, 255, 0.12) !important;
}

.rcp-iteminfo {
  --ro-bg: #23262e;
  --ro-bg-raised: #2c3039;
  --ro-bg-sunken: #171a20;
  --ro-bg-slot: #12141a;
  --ro-tooltip-rgb: 18, 20, 26;
  --ro-border: #4a505e;
  --ro-border-soft: #383d48;
  --ro-border-bright: #6b7385;
  --ro-text: #f2f4f8;
  --ro-text-dim: #a2a9b8;
  --ro-text-faint: #6f7688;
  --ro-accent: #e8b84b;
  --ro-hover-rgb: 255, 255, 255;
  --ro-radius: 10px;
  --ro-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  --ro-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --ro-font: "Segoe UI", "Noto Sans", Arial, sans-serif;

  display: none;
  flex-direction: column;
  width: 100%;
  max-height: var(--rcp-panel-max, calc(100vh - 28px));
  min-height: 160px;
  font-family: var(--ro-font);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ro-text);
  background: linear-gradient(180deg, var(--ro-bg-raised) 0%, var(--ro-bg) 100%);
  border: 1px solid var(--ro-border);
  border-radius: var(--ro-radius);
  box-shadow: var(--ro-shadow), var(--ro-inset);
  overflow: hidden;
}
.rcp-iteminfo.is-open { display: flex; }
.rcp-iteminfo.is-loading .preview-body { opacity: 0.6; }
.rcp-iteminfo,
.rcp-iteminfo *,
.rcp-iteminfo *::before,
.rcp-iteminfo *::after { box-sizing: border-box; }
.rcp-iteminfo [hidden] { display: none !important; }

/* Title bar */
.rcp-iteminfo .titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ro-border-soft);
}
.rcp-iteminfo .win-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ro-text-faint);
}
.rcp-iteminfo .titlebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rcp-iteminfo .close-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--ro-border);
  border-radius: 8px;
  background: var(--ro-bg-sunken);
  color: var(--ro-text-dim);
  cursor: pointer;
}
.rcp-iteminfo .close-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.rcp-iteminfo .close-btn:hover,
.rcp-iteminfo .close-btn:focus {
  border-color: var(--ro-accent);
  color: var(--ro-accent);
  outline: none;
}

/* Shell: the body, with a card's illustration stacked above it. The client
   widens its window for the art; a column beside the list keeps its width,
   so the art sits on top instead. */
.rcp-iteminfo .preview-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.rcp-iteminfo .card-illust-panel {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  min-height: 0;
  padding: 10px;
  border-bottom: 1px solid var(--ro-border-soft);
  background: var(--ro-bg-slot);
}
.rcp-iteminfo .card-illust {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(400px, 42vh);
  overflow: hidden;
  border: 1px solid var(--ro-border-soft);
  border-radius: 8px;
  background: #14161c;
}
.rcp-iteminfo .card-illust img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.rcp-iteminfo .preview-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 12px 12px 0;
}

/* Hero: art, name, weight, card slots */
.rcp-iteminfo .preview-hero {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 0 0 auto;
  margin-bottom: 12px;
}
.rcp-iteminfo .preview-art {
  flex: 0 0 75px;
  width: 75px;
  height: 100px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--ro-border-soft);
  background: #fff;
}
.rcp-iteminfo .preview-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.rcp-iteminfo .preview-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.rcp-iteminfo .preview-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ro-text);
  overflow-wrap: anywhere;
}
.rcp-iteminfo .preview-weight {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ro-text-dim);
}
.rcp-iteminfo .preview-weight-label {
  margin-right: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ro-text-faint);
}
.rcp-iteminfo .cardlist { margin-top: 8px; }
.rcp-iteminfo .cardlist .border {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.rcp-iteminfo .cardlist .item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ro-border-soft);
  border-radius: 7px;
  background: rgba(var(--ro-hover-rgb), 0.03);
}
.rcp-iteminfo .cardlist .item .icon {
  width: 24px;
  height: 24px;
  background: center / contain no-repeat;
  image-rendering: pixelated;
}
.rcp-iteminfo .cardlist .item .icon-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ro-text-dim);
}
.rcp-iteminfo .cardlist .item.is-card { cursor: pointer; }
.rcp-iteminfo .cardlist .item.is-card:hover { border-color: var(--ro-accent); }
.rcp-iteminfo .cardlist .item.is-empty .icon {
  width: 18px;
  height: 18px;
  border: 1px dashed var(--ro-border-bright);
  border-radius: 4px;
}
.rcp-iteminfo .cardlist .item.is-disabled {
  border-style: dashed;
  opacity: 0.4;
}
.rcp-iteminfo .cardlist .item .name {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  white-space: nowrap;
  z-index: 6;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(var(--ro-tooltip-rgb), 0.94);
  color: var(--ro-text);
  border: 1px solid var(--ro-border);
  box-shadow: var(--ro-shadow);
  font-size: 11px;
  pointer-events: none;
}
.rcp-iteminfo .cardlist .item:hover .name { display: block; }

/* Description */
.rcp-iteminfo .preview-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: #4a4a52 rgba(0, 0, 0, 0.22);
}
.rcp-iteminfo .preview-main::-webkit-scrollbar { width: 8px; }
.rcp-iteminfo .preview-main::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
}
.rcp-iteminfo .preview-main::-webkit-scrollbar-thumb {
  background: #4a4a52;
  border-radius: 8px;
}
.rcp-iteminfo .preview-desc {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ro-text);
}
.rcp-iteminfo .preview-desc span { white-space: pre-wrap; }
.rcp-iteminfo .item-ref {
  appearance: none;
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rcp-iteminfo .item-ref:hover { filter: brightness(1.18); }
.rcp-iteminfo .preview-rule {
  flex: 0 0 auto;
  height: 0;
  margin: 10px 0;
  border: 0;
  border-top: 1px solid var(--ro-border-soft);
}
.rcp-iteminfo .preview-stats {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ro-text);
  white-space: pre-wrap;
}
.rcp-iteminfo .preview-stats span { white-space: pre-wrap; }
.rcp-iteminfo .preview-stats .stat-line {
  display: flex;
  align-items: baseline;
}
.rcp-iteminfo .preview-stats .stat-line-plain { display: block; }
.rcp-iteminfo .preview-stats .stat-sep { display: none; }
.rcp-iteminfo .preview-stats .stat-label { flex: 0 0 auto; }
.rcp-iteminfo .preview-stats .stat-fill {
  flex: 1 1 auto;
  min-width: 14px;
  align-self: flex-end;
  margin: 0 6px 0.35em;
  border-bottom: 1px dotted var(--ro-border);
}
.rcp-iteminfo .preview-stats .stat-value {
  flex: 0 1 auto;
  margin-left: auto;
  text-align: right;
}

/* Footer: jobs, class / compound, move restrictions */
.rcp-iteminfo .preview-footer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  padding: 10px 0 12px;
  border-top: 1px solid var(--ro-border-soft);
  background: var(--ro-bg);
}
.rcp-iteminfo .preview-jobs {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ro-text-dim);
}
.rcp-iteminfo .preview-section-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ro-text-faint);
}
.rcp-iteminfo .preview-jobs .preview-section-title + div + .preview-section-title { margin-top: 8px; }
.rcp-iteminfo .moveinfo-btn {
  appearance: none;
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(224, 112, 112, 0.45);
  border-radius: 8px;
  background: rgba(224, 112, 112, 0.12);
  color: #e07070;
  cursor: help;
}
.rcp-iteminfo .moveinfo-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.rcp-iteminfo .moveinfo-btn:hover,
.rcp-iteminfo .moveinfo-btn:focus {
  border-color: #e07070;
  background: rgba(224, 112, 112, 0.2);
  outline: none;
}

#rcp-moveinfo-tip {
  position: fixed;
  z-index: 10002;
  display: none;
  max-width: 240px;
  padding: 7px 8px 8px;
  border: 1px solid #4a505e;
  border-radius: 8px;
  background: rgba(23, 26, 32, 0.94);
  color: #f2f4f8;
  font: 11px/1.35 "Segoe UI", Tahoma, sans-serif;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}
#rcp-moveinfo-tip strong {
  display: block;
  margin-bottom: 4px;
  color: #e07070;
  font-size: 11px;
}

/* Narrow screens: the item column drops below the list */
@media (max-width: 900px) {
  .rcp-itemlist-layout { flex-direction: column; }
  .rcp-itemlist-side {
    flex: 0 0 auto;
    width: 100%;
  }
  .rcp-itemlist-side-inner {
    position: static;
    width: auto;
    max-height: none;
    transform: none;
  }
  .rcp-iteminfo { max-height: none; }
  .rcp-iteminfo .preview-main { overflow-y: visible; }
  .rcp-iteminfo .card-illust { height: 300px; }
}

/* Monster window (js/monster-panel.js): same shell, its own sections */
/* The title bar carries the monster's name rather than a window label. */
.rcp-mobinfo .win-title {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ro-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The sprite sits on the window itself: no box, no backdrop. */
.rcp-mobinfo .mob-art {
  background: transparent;
  border: 0;
  border-radius: 0;
}
.rcp-mobinfo .mob-art img { image-rendering: auto; }
.rcp-mobinfo .mob-muted { color: var(--ro-text-dim); font-weight: 400; }
.rcp-mobinfo .mob-tag {
  display: inline-block;
  vertical-align: 1px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(232, 184, 75, 0.5);
  background: rgba(232, 184, 75, 0.14);
  color: var(--ro-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rcp-mobinfo .mob-tag-plain {
  border-color: var(--ro-border);
  background: rgba(var(--ro-hover-rgb), 0.05);
  color: var(--ro-text-dim);
}
.rcp-mobinfo .mob-statgrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
}
.rcp-mobinfo .mob-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  border: 1px solid var(--ro-border-soft);
  border-radius: 7px;
  background: rgba(var(--ro-hover-rgb), 0.03);
}
.rcp-mobinfo .mob-stat-k {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ro-text-faint);
}
.rcp-mobinfo .mob-stat-v { font-size: 12px; font-weight: 600; }
.rcp-mobinfo .mob-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.rcp-mobinfo .mob-mode {
  padding: 2px 7px;
  border: 1px solid var(--ro-border-soft);
  border-radius: 6px;
  background: rgba(var(--ro-hover-rgb), 0.03);
  font-size: 11px;
  color: var(--ro-text-dim);
}
.rcp-mobinfo .mob-drops { display: flex; flex-direction: column; gap: 2px; }
.rcp-mobinfo .mob-drop {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 3px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--ro-text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.rcp-mobinfo .mob-drop:hover,
.rcp-mobinfo .mob-drop:focus {
  border-color: var(--ro-border-soft);
  background: rgba(var(--ro-hover-rgb), 0.04);
  outline: none;
}
.rcp-mobinfo .mob-drop-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  background: center / contain no-repeat;
  image-rendering: pixelated;
}
.rcp-mobinfo .mob-drop-name { flex: 0 1 auto; min-width: 0; }
.rcp-mobinfo .mob-drop .stat-fill {
  flex: 1 1 auto;
  min-width: 14px;
  align-self: flex-end;
  margin: 0 4px 0.45em;
  border-bottom: 1px dotted var(--ro-border);
}
.rcp-mobinfo .mob-drop-rate {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--ro-accent);
}
.rcp-mobinfo .mob-note {
  margin-top: 6px;
  font-size: 11px;
  font-style: italic;
  color: var(--ro-text-dim);
}
.rcp-mobinfo .mob-skills { display: flex; flex-direction: column; gap: 6px; }
.rcp-mobinfo .mob-skill-name { font-size: 12px; font-weight: 600; }
.rcp-mobinfo .mob-skill-meta { font-size: 11px; color: var(--ro-text-dim); }
