/* Search, product photos and price graph (added in v3) */
[data-search-item][hidden], [data-trader-only][hidden] { display: none !important; }
.stall-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--gold-100); color: var(--warning); font-weight: 700; }
.mystall-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.muted-row td { color: var(--ink-500); }
.search-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; }
.search-toolbar label { font-weight: 700; color: var(--forest-800); }
.search-toolbar input[type="search"] { flex: 1 1 260px; max-width: 520px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--ink-900); font: inherit; }
.search-toolbar input[type="search"]:focus { outline: 2px solid var(--leaf-500); outline-offset: 1px; }
.search-status { color: var(--ink-500); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.product-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; background: var(--leaf-50); }
.product-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.card-photo { width: 100%; height: 150px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; display: block; background: var(--leaf-50); }
.photo-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.photo-form input[type="file"] { max-width: 210px; font-size: .85rem; color: var(--ink-700); }

.price-chart-panel { margin: 0 0 22px; }
.price-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.price-chart-head h2 { margin: 2px 0 0; }
.price-chart-select { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--forest-800); }
.price-chart { position: relative; min-height: 120px; }
.price-chart-svg { width: 100%; height: auto; display: block; }
.price-chart-empty { margin: 30px 0; text-align: center; color: var(--ink-500); }
.pc-grid { stroke: var(--line); stroke-width: 1; }
.pc-axis { fill: var(--ink-500); font-size: 11px; }
.pc-line { stroke: var(--forest-700); stroke-width: 2.5; stroke-linejoin: round; }
.pc-dot { fill: var(--white); stroke: var(--forest-700); stroke-width: 2.5; cursor: pointer; }
.pc-dot:hover, .pc-dot:focus { fill: var(--gold-500); outline: none; }
.price-chart-controls { display: flex; flex-wrap: wrap; gap: 12px; }
.pc-ma { stroke: var(--gold-500); stroke-width: 2.5; stroke-dasharray: 7 5; stroke-linejoin: round; pointer-events: none; }
.price-trend { margin: 4px 0 12px; color: var(--ink-700); }
.price-trend-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-weight: 700; margin-right: 6px; }
.price-trend-badge.is-rising { background: var(--leaf-100); color: var(--forest-800); }
.price-trend-badge.is-falling { background: var(--danger-soft); color: var(--danger); }
.price-trend-badge.is-steady { background: var(--warning-soft); color: var(--warning); }
.price-chart-tip { position: absolute; transform: translate(-50%, -100%); background: var(--forest-900); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .8rem; white-space: nowrap; pointer-events: none; }

/* Show / hide password button */
.pw-wrap { position: relative; display: block; margin-top: 7px; }
.pw-wrap input { width: 100%; margin-top: 0; padding-right: 64px; box-sizing: border-box; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--forest-700); font-weight: 700; font-size: .85rem; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.pw-toggle:hover, .pw-toggle:focus { background: var(--leaf-100); outline: none; }

/* Stall cards: product + quantity always visible, even on narrow phone screens */
.stall-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; }
.stall-card { min-width: 0; overflow: visible; }
.stall-stock { list-style: none; margin: 10px 0 0; padding: 0; }
.stall-stock li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.stall-product { min-width: 0; overflow-wrap: anywhere; }
.stall-qty { flex: none; color: var(--forest-700); white-space: nowrap; }

/* No decorative circles on stall cards (they covered the quantity) */
.stall-card::before, .stall-card::after { display: none !important; content: none !important; }

/* interactive price graph */
.range-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; }
.range-btn { border: 1px solid var(--line); background: var(--white); color: var(--forest-800); border-radius: 999px; padding: 5px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.range-btn[aria-pressed="true"] { background: var(--forest-700); color: #fff; border-color: var(--forest-700); }
.range-avg { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; color: var(--ink-500); }
.pc-area { fill: var(--forest-700); opacity: .08; }
.pc-hold { stroke: var(--forest-700); stroke-width: 2; stroke-dasharray: 2 4; opacity: .6; }
.pc-guide { stroke: var(--ink-500); stroke-width: 1; stroke-dasharray: 3 3; }
.pc-focus { fill: var(--gold-500); stroke: var(--white); stroke-width: 2; pointer-events: none; }
.price-chart-svg:focus-visible { outline: 2px solid var(--forest-700); outline-offset: 2px; }
.icon { display: inline-block; vertical-align: -0.2em; flex: none; }
.avail-form { margin: 0; }
.avail-select { border-radius: 999px; font-weight: 700; padding: 6px 12px; border: 1px solid var(--line); min-width: 8.5rem; }
.avail-select.is-in { background: #e8f5ec; color: var(--forest-800); border-color: #b7dcc3; }
.avail-select.is-out { background: #fdeceb; color: #9b2c2c; border-color: #f0c2bf; }
.category-filter { min-width: 11rem; }
.queue-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.queue-panel h2 { margin: 2px 0 4px; }
.queue-panel p { margin: 0; }
.range-avg input { width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--forest-700); }
.range-avg { white-space: nowrap; }

/* ---- v31: trader phone, messaging, all-stock totals, stock history ---- */
.stall-phone { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 700; color: var(--forest-700); text-decoration: none; }
.stall-phone:hover, .stall-phone:focus { text-decoration: underline; }
.stall-message { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; }

.chat-row { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink-900); }
.chat-row:first-child { border-top: 0; }
.chat-row:hover, .chat-row:focus { background: var(--leaf-50); outline: none; }
.chat-row.is-unread .chat-preview { color: var(--ink-900); font-weight: 700; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-preview { color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; color: var(--ink-500); }

.chat-panel { display: flex; flex-direction: column; gap: 16px; }
.chat-thread { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; min-height: 160px; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: min(78%, 520px); padding: 10px 14px; border-radius: 16px; overflow-wrap: anywhere; }
.bubble p { margin: 0 0 4px; white-space: pre-wrap; }
.bubble small { opacity: .75; font-size: .75rem; }
.bubble.mine { align-self: flex-end; background: var(--forest-700); color: #fff; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--leaf-100); color: var(--ink-900); border-bottom-left-radius: 4px; }
.chat-form { display: flex; flex-direction: column; gap: 8px; }
.chat-form label { font-weight: 700; color: var(--forest-800); }
.chat-form textarea { width: 100%; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line); padding: 10px 12px; font: inherit; resize: vertical; }
.chat-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

.stock-totals { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 14px; }
.stock-totals .chart-summary-item { min-width: 150px; }
.holders summary { cursor: pointer; font-weight: 700; color: var(--forest-700); }
.holders ul { list-style: none; margin: 8px 0 2px; padding: 0; }
.holders li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 0; border-top: 1px solid var(--line); }
.holder-who { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.holder-contact { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
tr.total-row td { background: var(--leaf-50); border-top: 2px solid var(--forest-700); }

.stock-history-panel { margin: 0 0 22px; }
.sh-line { fill: none; stroke: var(--forest-700); stroke-width: 2.5; stroke-linejoin: round; }
.sh-area { fill: var(--forest-700); opacity: .1; }
.sh-dot { fill: var(--white); stroke: var(--forest-700); stroke-width: 2; }
.sh-focus { fill: var(--gold-500); stroke: var(--white); stroke-width: 2; pointer-events: none; }
/* message text stays readable on every bubble */
.bubble p, .bubble small { color: inherit; }
.bubble.mine, .bubble.mine p, .bubble.mine small { color: #fff; }
.bubble.theirs, .bubble.theirs p, .bubble.theirs small { color: #10261a; }
.chat-preview { color: var(--ink-700); }
.chat-row.is-unread .chat-preview { color: #10261a; }

.sh-price { fill: none; stroke: #c98a10; stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 7 4; }
.sh-price-dot { fill: var(--white); stroke: #c98a10; stroke-width: 2; }
.pc-axis.price { fill: #8a5a12; }
.sh-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--ink-700); margin: 2px 0 6px; }
.sh-legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--forest-700); vertical-align: middle; margin-right: 6px; }
.sh-legend i.price { border-top: 3px dashed #c98a10; }
#stockHistory .price-chart-svg { display: block; width: 100%; height: auto; }
.notice p { white-space: pre-line; }
