/* OpenVibe.Inventory — theme-token driven (openvibe-shared presets). Every page works without JavaScript. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg-primary, #0a0f1c); color: var(--text-primary, #e6edf7); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-light, #60a5fa); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent, #3b82f6); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg-card, #131c2e); padding: 8px 12px; z-index: 10; }
.account-bar { max-width: 1080px; margin: 0 auto; padding: 6px 16px 0; text-align: right; font-size: 14px; color: var(--text-secondary, #96a7c2); }
.page { max-width: 1080px; margin: 0 auto; padding: 16px 16px 64px; min-height: 60vh; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 1rem 0 .6rem; overflow-wrap: anywhere; }
h2 { font-size: 1.3rem; margin: 1.8rem 0 .5rem; }
h3 { font-size: 1.08rem; margin: 1.2rem 0 .4rem; }
.muted { color: var(--text-muted, #7386a3); }
.small { font-size: .85rem; }
.crumbs { font-size: .9rem; color: var(--text-muted, #7386a3); margin: 8px 0; overflow-wrap: anywhere; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
code { overflow-wrap: anywhere; }
pre { background: var(--bg-secondary, #0f1729); border: 1px solid var(--border, #1f2d47); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
pre code { overflow-wrap: normal; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; vertical-align: top; padding: 7px 9px; border-bottom: 1px solid var(--border, #1f2d47); }
th { color: var(--text-secondary, #96a7c2); font-weight: 600; }
.badge { display: inline-block; font-size: .75rem; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-light, #2c3d5c); white-space: nowrap; line-height: 1.6; }
.badge.ok { border-color: var(--success, #22c55e); color: var(--success, #22c55e); }
.badge.info { border-color: var(--info, #38bdf8); color: var(--info, #38bdf8); }
.badge.warn { border-color: var(--warning, #f59e0b); color: var(--warning, #f59e0b); }
.badge.bad { border-color: var(--error, #ef4444); color: var(--error, #ef4444); }
.notice { border-left: 3px solid var(--info, #38bdf8); padding: 8px 12px; margin: 12px 0; background: var(--bg-card, #131c2e); border-radius: 0 8px 8px 0; }
.notice.ok { border-left-color: var(--success, #22c55e); }
.notice.warn { border-left-color: var(--warning, #f59e0b); }
.notice.bad { border-left-color: var(--error, #ef4444); }
button { font: inherit; cursor: pointer; }
form.inline { display: inline; }
.prose { max-width: 820px; overflow-wrap: anywhere; }
.prose table { margin: .6rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* The home page's showcase sections (openvibe-shared/showcase.css) sit inside .page, which has its own gutter. */
.page .sc-hero, .page .sc-sec, .page .sc-cta { padding-left: 0; padding-right: 0; }
.page .sc-ic .ov-icon { --ovi-size: 28px !important; }
button.sc-btn { background: transparent; }
button.sc-btn.sc-primary { border: 0; }
.lede { color: var(--text-secondary, #96a7c2); max-width: 72ch; }
.stats { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.stats li { border: 1px solid var(--border, #1f2d47); border-radius: 10px; padding: 8px 12px; background: var(--bg-card, #131c2e); color: var(--text-secondary, #96a7c2); }
.stats b { display: block; font-size: 1.15rem; color: var(--text-primary, #e6edf7); }

/* ── Rarity: one hue per tier, shown as it is (ADR-054) ── */
.r-common { --rar: #94a3b8; }
.r-uncommon { --rar: #4ade80; }
.r-rare { --rar: #38bdf8; }
.r-epic { --rar: #c084fc; }
.r-legendary { --rar: #fbbf24; }
.inv-rarity { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--rar); border: 1px solid color-mix(in srgb, var(--rar) 55%, transparent); background: color-mix(in srgb, var(--rar) 12%, transparent); border-radius: 999px; padding: 0 8px; line-height: 1.7; white-space: nowrap; }

/* ── The item tile: its emoji or image on a rarity glow ── */
.inv-art { display: inline-grid; place-items: center; flex: none; border-radius: 14px; line-height: 1; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rar, #94a3b8) 30%, transparent), color-mix(in srgb, var(--rar, #94a3b8) 6%, var(--bg-secondary, #0f1729)) 70%); border: 1px solid color-mix(in srgb, var(--rar, #94a3b8) 40%, var(--border, #1f2d47)); }
.inv-art img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.inv-art-md { width: 56px; height: 56px; font-size: 28px; }
.inv-art-lg { width: 64px; height: 64px; font-size: 32px; }
.inv-art-xl { width: 112px; height: 112px; font-size: 58px; border-radius: 22px; }
.r-legendary .inv-art, .inv-art.r-legendary { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rar) 25%, transparent), 0 10px 30px -12px color-mix(in srgb, var(--rar) 70%, transparent); }

/* ── Item cards ── */
.inv-grid { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.inv-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border, #1f2d47); border-top: 3px solid color-mix(in srgb, var(--rar) 70%, transparent); border-radius: 12px; padding: 12px; background: var(--bg-card, #131c2e); min-width: 0; }
.inv-card-link { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.inv-card-link:hover .inv-card-name { text-decoration: underline; }
.inv-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.inv-card-name { font-weight: 650; overflow-wrap: anywhere; }
.inv-card-desc { margin: 0; font-size: .88rem; color: var(--text-secondary, #96a7c2); }
.inv-card-meta { margin: 0; font-size: .8rem; color: var(--text-muted, #7386a3); }
.inv-equip { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.inv-equip .sc-btn { padding: 6px 14px; font-size: .88rem; }
.inv-worn { margin: 0; font-size: .8rem; font-weight: 700; color: var(--success, #22c55e); }
.inv-worn::before { content: "● "; }

/* ── Kind tabs on /items ── */
.inv-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }
.inv-tabs a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-light, #2c3d5c); color: var(--text-secondary, #96a7c2); text-decoration: none; font-size: .9rem; }
.inv-tabs a[aria-current="page"] { border-color: var(--accent, #3b82f6); color: var(--text-primary, #e6edf7); background: color-mix(in srgb, var(--accent, #3b82f6) 14%, transparent); }
.inv-kind h2 .small { font-weight: 400; }

/* ── One item ── */
.inv-detail { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 6px 0 4px; }
.inv-detail h1 { margin: 0 0 6px; }

/* ── The home hero's panel: a few of the rarest items ── */
.inv-hero-panel { padding: 20px; border-radius: 18px; border: 1px solid var(--border, #1f2d47); background: linear-gradient(160deg, color-mix(in srgb, #fbbf24 8%, var(--bg-card, #131c2e)), var(--bg-card, #131c2e) 65%); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .7); }
.inv-hero-title { margin: 0 0 12px; font-weight: 750; font-size: 1rem; }
.inv-hero-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.inv-hero-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit; text-decoration: none; text-align: center; }
.inv-hero-grid a:hover .inv-hero-name { text-decoration: underline; }
.inv-hero-name { font-size: .78rem; color: var(--text-secondary, #96a7c2); overflow-wrap: anywhere; line-height: 1.25; }
@media (max-width: 520px) { .inv-art-xl { width: 88px; height: 88px; font-size: 46px; } .inv-grid { grid-template-columns: 1fr; } }
.inv-btn { font: inherit; font-size: .88rem; font-weight: 650; padding: 6px 16px; border-radius: 10px; border: 1px solid var(--border-light, #2c3d5c); background: transparent; color: var(--text-primary, #e6edf7); }
.inv-btn:hover { border-color: var(--accent, #3b82f6); background: var(--bg-hover, #1c2a44); }
.inv-btn.primary { border-color: transparent; color: var(--on-accent, #fff); background: linear-gradient(135deg, var(--accent, #3b82f6), var(--accent-dark, #1d4ed8)); }
.inv-btn.primary:hover { filter: brightness(1.08); }
.inv-equip .inv-worn { margin-right: auto; }
.inv-card.is-worn { border-color: color-mix(in srgb, var(--success, #22c55e) 55%, var(--border, #1f2d47)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--success, #22c55e) 30%, transparent); }

/* The Workshop (ADR-054 §6): community badges, your submissions, the staff review queue. */
.ws-steps { padding-left: 1.2rem; line-height: 1.6; }
.ws-steps li { margin: 0 0 6px; }
.ws-img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.ws-form { display: grid; gap: 12px; max-width: 560px; }
.ws-form label { display: grid; gap: 4px; font-weight: 600; }
.ws-form input[type=text], .ws-form input[type=number], .ws-form textarea, .ws-give input, .ws-review input, .ws-review select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border, #1f2d47); background: var(--bg-secondary, #101828); color: inherit; }
.ws-form input, .ws-form textarea { font-weight: 400; }
.ws-check { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 400 !important; }
.ws-mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ws-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--border, #1f2d47); border-radius: 12px; background: var(--bg-secondary, #101828); }
.ws-item-body { flex: 1; min-width: 0; }
.ws-item-body h2 { margin: 0 0 6px; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ws-state { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--border, #1f2d47); }
.ws-published { color: #22c55e; border-color: color-mix(in srgb, #22c55e 50%, transparent); }
.ws-in_review { color: #f59e0b; border-color: color-mix(in srgb, #f59e0b 50%, transparent); }
.ws-draft { color: #ef4444; border-color: color-mix(in srgb, #ef4444 50%, transparent); }
.ws-give, .ws-review { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.ws-give label, .ws-review label { display: grid; gap: 4px; font-size: .85rem; }
.ws-reason { flex: 1; min-width: 200px; }
