/* Not-for-trade list page (/nft). The shell, hero, panels, fields, buttons and the owner
   dialog are the same as Inventory's (webpages/inventory.js); the list styles follow them. */
html:has(.garam-nft-page), body:has(.garam-nft-page) {
    background-color:var(--garam-theme-surface, #d2edfe) !important; background-image:none !important;
}
.garam-nft-page { width:100%; min-height:100vh; box-sizing:border-box; padding:24px 16px 52px;
    color:var(--garam-c-123c5c, #123c5c); font-family:inherit; }
.garam-nft-page *, #nftOwnerModal * { box-sizing:border-box; }
.garam-nft-page [hidden], #nftOwnerModal [hidden] { display:none !important; }

/* ---- Inventory shell ---- */
.garam-nft-page .garam-guest-landing { min-height:calc(100dvh - 100px); width:100%;
    display:flex; align-items:center; justify-content:center; padding:22px 12px; }
.garam-nft-page .garam-guest-card { width:min(100%,530px); background:#fff; border:1px solid var(--garam-c-b1d8f2, #b1d8f2);
    border-radius:24px; padding:clamp(20px,5vw,36px); box-shadow:0 20px 60px rgba(var(--garam-rgb-044b7a, 4,75,122),.18); }
.garam-nft-page .garam-guest-card .garam-owner-modal-header h2 { font-size:clamp(25px,5vw,35px); }
.garam-nft-page .garam-guest-actions { justify-content:flex-end; }
.garam-nft-page .garam-guest-actions .garam-owner-action-primary { min-width:115px; }
.garam-nft-page .garam-inventory-layout { width:100%; max-width:1240px; margin:0 auto; }
.garam-nft-page .garam-inventory-hero { position:relative; z-index:2; overflow:visible; isolation:isolate;
    text-align:center; padding:44px 12px 48px; }
.garam-nft-page .garam-inventory-hero::before { content:""; position:absolute; inset:0; z-index:-1;
    background-image:radial-gradient(var(--garam-c-86c7ed, #86c7ed) 1px,transparent 1px);
    background-size:22px 22px; opacity:.28; mask-image:linear-gradient(to bottom,black 20%,transparent 95%); pointer-events:none; }
.garam-nft-page .garam-hero-title { display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
    column-gap:18px; row-gap:10px; margin:0; color:#fff; font-size:clamp(36px,6vw,76px); font-weight:850;
    line-height:1.1; letter-spacing:-.045em; }
.garam-nft-page .garam-avatar-control { position:relative; display:inline-flex; align-items:center;
    justify-content:center; flex-shrink:0; z-index:3; }
.garam-nft-page .garam-avatar-button { position:relative; display:inline-flex; align-items:center; justify-content:center;
    border:0; border-radius:50%; padding:0; background:transparent; cursor:pointer; overflow:hidden; transition:transform .18s; }
.garam-nft-page .garam-avatar-button:hover { transform:translateY(-2px) scale(1.035); }
.garam-nft-page .garam-avatar-button:focus-visible { outline:3px solid var(--garam-c-178fda, #178fda); outline-offset:7px; }
.garam-nft-page .garam-inventory-avatar { display:block; width:clamp(68px,7vw,96px); height:clamp(68px,7vw,96px);
    border-radius:50%; object-fit:cover; border:5px solid #fff; background:var(--garam-c-caeaff, #caeaff);
    box-shadow:0 8px 30px rgba(var(--garam-rgb-166396, 22,99,150),.23),0 0 0 3px var(--garam-c-91d5fa, #91d5fa);
    transition:opacity .18s ease; }
.garam-nft-page .garam-inventory-avatar.is-loading { opacity:.55; }
.garam-nft-page .garam-avatar-overlay { position:absolute; inset:5px; display:flex; flex-direction:column;
    align-items:center; justify-content:center; border-radius:50%; background:rgba(0,0,0,.62); color:#fff;
    font:inherit; font-size:clamp(11px,1.2vw,14px); font-weight:800; line-height:1.15; letter-spacing:0;
    text-transform:lowercase; opacity:0; pointer-events:none; transition:opacity .18s ease; }
.garam-nft-page .garam-avatar-button:hover .garam-avatar-overlay,
.garam-nft-page .garam-avatar-button:focus-visible .garam-avatar-overlay { opacity:1; }
.garam-nft-page .garam-owner-instruction { margin:17px 0 0; color:#fff; font-size:16px; }
.garam-nft-page .garam-filter-panel { padding:24px; background:#fff; border:1px solid var(--garam-c-bbdef5, #bbdef5);
    border-radius:24px; box-shadow:0 14px 30px rgba(var(--garam-rgb-156399, 21,99,153),.12); }
.garam-nft-page .garam-filters { display:grid; gap:14px; }
.garam-nft-page .garam-filter { display:flex; flex-direction:column; gap:7px; min-width:0; }
.garam-nft-page .garam-filter span { color:var(--garam-c-44718d, #44718d); font-size:13px; font-weight:700; }
.garam-nft-page .garam-filter .inputStyle { margin:0; display:block; width:100%; min-width:0; max-width:100%;
    height:45px; padding:10px 12px; border:1px solid var(--garam-c-b7d8ed, #b7d8ed); border-radius:13px;
    background:var(--garam-c-f0f9ff, #f0f9ff); color:var(--garam-c-123c5c, #123c5c); font:inherit; font-size:14px; box-shadow:none; }
.garam-nft-page .garam-filter .inputStyle::placeholder { color:var(--garam-c-84a9be, #84a9be); }
.garam-nft-page .garam-filter .inputStyle:focus { outline:2px solid var(--garam-c-51a8e8, #51a8e8); outline-offset:1px; }
.garam-nft-page .garam-toolbar { display:flex; justify-content:space-between; align-items:end; flex-wrap:wrap; gap:12px; margin-top:16px; }
.garam-nft-page .garam-filter-hint { color:var(--garam-c-527f99, #527f99); font-size:12px; flex:1; min-width:205px; }
.garam-nft-page .garam-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:9px; }
.garam-nft-page .garam-button { display:inline-flex; justify-content:center; align-items:center; gap:7px;
    min-height:42px; padding:9px 15px; border-radius:13px; font:inherit; font-size:13px; font-weight:700;
    cursor:pointer; text-decoration:none; transition:background .15s,transform .15s; }
.garam-nft-page .garam-button:active { transform:translateY(1px); }
.garam-nft-page .garam-button:disabled { opacity:.55; cursor:wait; }
.garam-nft-page .garam-button-outline { border:1px solid var(--garam-c-a9cfea, #a9cfea); background:#fff; color:var(--garam-c-155a8d, #155a8d); }
.garam-nft-page .garam-button-outline:hover { background:var(--garam-c-e5f5ff, #e5f5ff); }
.garam-nft-page .garam-button-primary { border:1px solid var(--garam-c-0764a6, #0764a6); background:var(--garam-c-087cce, #087cce);
    color:#fff; box-shadow:0 4px 0 var(--garam-c-075a91, #075a91); }
.garam-nft-page .garam-button-primary:hover { background:var(--garam-c-056aae, #056aae); }
.garam-nft-page .garam-results-heading { display:flex; align-items:center; min-height:44px; margin-top:17px; }
.garam-nft-page .garam-empty-inventory { display:flex; justify-content:center; align-items:center; gap:16px;
    padding:50px 12px; color:var(--garam-c-27658a, #27658a); }
.garam-nft-page .garam-empty-inventory h2 { margin:0; font-size:20px; }

/* Owner dialog */
#nftOwnerModal.garam-owner-modal { position:fixed; inset:0; z-index:100001; display:flex; align-items:center;
    justify-content:center; padding:18px; background:rgba(var(--garam-rgb-062743, 6,39,67),.7);
    opacity:0; visibility:hidden; pointer-events:none; transition:opacity .2s; }
#nftOwnerModal.garam-owner-modal.is-open { opacity:1; visibility:visible; pointer-events:auto; }
.garam-nft-page .garam-owner-modal-panel, #nftOwnerModal .garam-owner-modal-panel { width:min(100%,485px);
    max-height:calc(100dvh - 36px); overflow:auto; padding:23px; border:1px solid var(--garam-c-b1d8f2, #b1d8f2);
    border-radius:23px; background:#fff; box-shadow:0 24px 70px rgba(var(--garam-rgb-042543, 4,37,67),.35); }
.garam-nft-page .garam-owner-modal-header, #nftOwnerModal .garam-owner-modal-header { display:flex;
    align-items:center; justify-content:space-between; gap:12px; }
.garam-nft-page .garam-owner-modal-header h2, #nftOwnerModal .garam-owner-modal-header h2 { margin:0;
    color:var(--garam-c-123c5c, #123c5c); font-size:24px; font-weight:850; }
.garam-nft-page .garam-owner-modal-description, #nftOwnerModal .garam-owner-modal-description { margin:13px 0 21px;
    color:var(--garam-c-537c97, #537c97); font-size:14px; }
.garam-nft-page .garam-owner-form, #nftOwnerModal .garam-owner-form { display:flex; flex-direction:column; gap:10px; }
.garam-nft-page .garam-owner-form label, #nftOwnerModal .garam-owner-form label { color:var(--garam-c-356d91, #356d91);
    font-size:14px; font-weight:800; }
.garam-nft-page .garam-owner-id-input, #nftOwnerModal .garam-owner-id-input { min-height:48px; padding:11px 13px;
    border:1px solid var(--garam-c-a9cfea, #a9cfea); border-radius:13px; outline:0; background:var(--garam-c-f0f9ff, #f0f9ff);
    color:var(--garam-c-123c5c, #123c5c); font:inherit; font-size:15px; }
.garam-nft-page .garam-owner-id-input:focus, #nftOwnerModal .garam-owner-id-input:focus {
    border-color:var(--garam-c-1687ce, #1687ce); box-shadow:0 0 0 3px var(--garam-c-d6efff, #d6efff); }
.garam-nft-page .garam-owner-error, #nftOwnerModal .garam-owner-error { margin:0; font-size:13px; color:#b32b42; }
.garam-nft-page .garam-owner-modal-actions, #nftOwnerModal .garam-owner-modal-actions { display:flex; align-items:center;
    justify-content:space-between; flex-wrap:wrap; gap:10px; margin-top:14px; }
.garam-nft-page .garam-owner-action, #nftOwnerModal .garam-owner-action { display:inline-flex; align-items:center;
    justify-content:center; min-height:44px; padding:10px 19px; border-radius:12px; font:inherit; font-size:14px;
    font-weight:800; cursor:pointer; }
.garam-nft-page .garam-owner-action-outline, #nftOwnerModal .garam-owner-action-outline { border:1px solid var(--garam-c-a9cfea, #a9cfea);
    background:#fff; color:var(--garam-c-155a8d, #155a8d); }
.garam-nft-page .garam-owner-action-primary, #nftOwnerModal .garam-owner-action-primary { min-width:92px;
    border:1px solid var(--garam-c-0764a6, #0764a6); background:var(--garam-c-087cce, #087cce); color:#fff;
    box-shadow:0 4px 0 var(--garam-c-075a91, #075a91); }
.garam-nft-page .garam-owner-action-primary:hover, #nftOwnerModal .garam-owner-action-primary:hover { background:var(--garam-c-056aae, #056aae); }
.garam-nft-page .garam-owner-action:disabled, #nftOwnerModal .garam-owner-action:disabled { opacity:.55; cursor:wait; }
#nftOwnerModal .garam-modal-close { display:inline-flex; align-items:center; gap:6px; min-height:38px; padding:7px 12px;
    border:1px solid var(--garam-c-a9cfea, #a9cfea); border-radius:11px; background:#fff; color:var(--garam-c-155a8d, #155a8d);
    font:inherit; font-size:13px; font-weight:800; cursor:pointer; }

/* ---- Add panel ---- */
.nft-add-heading h2 { margin:0; color:var(--garam-c-123c5c, #123c5c); font-size:21px; font-weight:850; }
.nft-add-heading p { margin:5px 0 16px; color:var(--garam-c-537c97, #537c97); font-size:14px; }
.garam-nft-page .nft-add-fields { grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1.1fr) minmax(0,1.4fr); }
.nft-status { margin:12px 0 0; padding:10px 13px; border-radius:12px; font-size:13px; font-weight:650;
    background:var(--garam-c-e9f7ff, #e9f7ff); color:var(--garam-c-155a8d, #155a8d); border:1px solid var(--garam-c-b9def3, #b9def3); }
.nft-status[data-tone="success"] { background:#e8f8ef; color:#17663b; border-color:#a9dfbf; }
.nft-status[data-tone="warning"] { background:#fff6e2; color:#7a5300; border-color:#f0d58e; }
.nft-status[data-tone="error"] { background:#fdecef; color:#9b1f35; border-color:#f3b9c4; }
.nft-private-note { margin:14px 0 0; padding:11px 15px; border-radius:14px; background:rgba(255,255,255,.75);
    color:var(--garam-c-155a8d, #155a8d); font-size:13px; font-weight:650; }

/* ---- Results ---- */
.garam-nft-page .nft-results-heading { justify-content:space-between; flex-wrap:wrap; gap:10px; }
#nftCount { margin:0; color:var(--garam-c-096dae, #096dae); font-size:14px; font-weight:650; }
.nft-results-tools { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.nft-search input { width:220px; max-width:100%; height:42px; padding:9px 13px; border:1px solid var(--garam-c-a9cfea, #a9cfea);
    border-radius:13px; background:#fff; color:var(--garam-c-123c5c, #123c5c); font:inherit; font-size:14px; }
.nft-search input:focus { outline:2px solid var(--garam-c-51a8e8, #51a8e8); outline-offset:1px; }
.nft-list-status { margin:0 0 12px; }
.nft-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); align-items:start; gap:14px;
    margin-top:6px; transition:opacity .2s; }
.nft-list > .garam-empty-inventory { grid-column:1 / -1; }
.nft-group { min-width:0; padding:15px 16px 16px; background:#fff; border:1px solid var(--garam-c-bbdef5, #bbdef5);
    border-radius:20px; box-shadow:0 10px 24px rgba(var(--garam-rgb-156399, 21,99,153),.09); }
.nft-group-events { grid-column:1 / -1; background:var(--garam-c-f0f9ff, #f0f9ff); }
.nft-group-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:11px; }
.nft-group-title { display:flex; align-items:center; gap:8px; min-width:0; margin:0; color:var(--garam-c-123c5c, #123c5c);
    font-size:17px; font-weight:850; overflow-wrap:anywhere; }
.nft-group-count { flex-shrink:0; min-width:26px; padding:2px 8px; border-radius:999px; background:var(--garam-c-16577f, #16577f);
    color:#fff; font-size:12px; font-weight:800; text-align:center; }
.garam-nft-page .nft-group-remove { min-height:32px; padding:5px 10px; border-radius:10px; font-size:12px; flex-shrink:0; }
.garam-nft-page .nft-group-remove.is-armed { border-color:#d9667a; background:#fdecef; color:#9b1f35; }
.nft-chips { display:flex; flex-wrap:wrap; gap:7px; margin:0; padding:0; list-style:none; }
.nft-chip { display:inline-flex; align-items:center; gap:2px; max-width:100%; min-height:32px; padding:4px 5px 4px 12px;
    border-radius:999px; background:var(--garam-c-e9f7ff, #e9f7ff); border:1px solid var(--garam-c-b9def3, #b9def3);
    color:var(--garam-c-155a8d, #155a8d); font-size:13px; font-weight:700; }
.nft-chip:not(:has(.nft-chip-remove)) { padding-right:12px; }
.nft-chip-label { min-width:0; overflow-wrap:anywhere; }
.nft-chip-remove { display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; flex-shrink:0;
    border:0; border-radius:50%; background:transparent; color:inherit; font:inherit; font-size:17px; line-height:1; cursor:pointer; }
.nft-chip-remove:hover { background:#fdecef; color:#9b1f35; }
.nft-chip-remove:focus-visible { outline:2px solid var(--garam-c-2396e2, #2396e2); outline-offset:1px; }
.nft-chip-remove:disabled { opacity:.45; cursor:wait; }

/* ---- Dark mode (same tokens as garam_dark.css) ---- */
html[data-garam-mode="dark"] body.garam-shell-body .nft-group,
html[data-garam-mode="dark"] body.garam-shell-body #nftOwnerModal .garam-owner-modal-panel {
    background:var(--garam-dark-panel) !important; color:var(--garam-dark-text) !important; border-color:var(--garam-dark-border) !important; }
html[data-garam-mode="dark"] body.garam-shell-body .nft-group-events,
html[data-garam-mode="dark"] body.garam-shell-body .nft-chip,
html[data-garam-mode="dark"] body.garam-shell-body .nft-search input,
html[data-garam-mode="dark"] body.garam-shell-body .nft-private-note,
html[data-garam-mode="dark"] body.garam-shell-body .garam-nft-page .garam-button-outline,
html[data-garam-mode="dark"] body.garam-shell-body #nftOwnerModal .garam-owner-action-outline,
html[data-garam-mode="dark"] body.garam-shell-body #nftOwnerModal .garam-modal-close,
html[data-garam-mode="dark"] body.garam-shell-body #nftOwnerModal .garam-owner-id-input {
    background:var(--garam-dark-raised) !important; color:var(--garam-dark-text) !important; border-color:var(--garam-dark-border) !important; }
html[data-garam-mode="dark"] body.garam-shell-body .nft-group-title,
html[data-garam-mode="dark"] body.garam-shell-body .nft-add-heading h2,
html[data-garam-mode="dark"] body.garam-shell-body #nftOwnerModal h2,
html[data-garam-mode="dark"] body.garam-shell-body .garam-nft-page .garam-empty-inventory { color:var(--garam-dark-text) !important; }
html[data-garam-mode="dark"] body.garam-shell-body .nft-add-heading p,
html[data-garam-mode="dark"] body.garam-shell-body #nftCount,
html[data-garam-mode="dark"] body.garam-shell-body #nftOwnerModal .garam-owner-modal-description,
html[data-garam-mode="dark"] body.garam-shell-body #nftOwnerModal .garam-owner-form label { color:var(--garam-dark-muted) !important; }
html[data-garam-mode="dark"] body.garam-shell-body .nft-chip-remove:hover,
html[data-garam-mode="dark"] body.garam-shell-body .garam-nft-page .garam-button-outline:hover { background:var(--garam-dark-hover) !important; }

@media (max-width:1050px) {
    .garam-nft-page .nft-add-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
/* Tablet and desktop: a grid of --nft-cols columns (4 to 12, following the window width)
   where each group takes --nft-span columns, as nft_script.js measures them. Rows end at
   the right edge. data-size xs/s/m/l/xl follows the share of the row. Phones ignore all this. */
@media (min-width:741px) {
    .nft-list { grid-template-columns:repeat(var(--nft-cols, 12),minmax(0,1fr)); align-items:stretch; }
    .nft-group { grid-column:span var(--nft-span, 4); order:var(--nft-order, 0); display:flex; flex-direction:column; }
    .nft-group-events { grid-column:1 / -1; order:-1; }
    .nft-group[data-size="xs"], .nft-group[data-size="s"] { padding:13px 14px 14px; border-radius:18px; }
    .nft-group[data-size="xs"] .nft-group-title { font-size:15px; }
    .nft-group[data-size="s"] .nft-group-title { font-size:16px; }
    .nft-group[data-size="l"] .nft-group-title { font-size:18px; }
    .nft-group[data-size="xl"] { padding:18px 20px 20px; border-radius:22px; }
    .nft-group[data-size="xl"] .nft-group-head { margin-bottom:14px; }
    .nft-group[data-size="xl"] .nft-group-title { font-size:20px; }
    .nft-group[data-size="xl"] .nft-group-count { padding:3px 10px; font-size:13px; }
    .nft-group.is-folded .nft-chips { position:relative; }
    .garam-nft-page .nft-group-toggle { align-self:center; min-height:36px; margin-top:14px; padding:7px 16px; border-radius:11px; }
}
@media (max-width:740px) {
    .garam-nft-page { padding:12px 9px 32px; }
    /* As in Inventory: the title and the instruction stack, centered. */
    .garam-nft-page .garam-inventory-hero { display:flex; flex-direction:column; align-items:center;
        justify-content:center; text-align:center; padding:28px 9px 34px; }
    .garam-nft-page #nftTitle { display:flex; width:100%; margin:0 auto; align-items:center; justify-content:center;
        flex-wrap:wrap; text-align:center; font-size:clamp(32px,7vw,50px); gap:12px; }
    .garam-nft-page #nftInstruction { display:block; width:100%; margin:16px auto 0; text-align:center; font-size:14px; }
    .garam-nft-page .garam-filter-panel { padding:16px; border-radius:18px; }
    .garam-nft-page .garam-filters { gap:11px; }
    .garam-nft-page .garam-actions { width:100%; justify-content:flex-end; }
    .nft-results-tools, .nft-search, .nft-search input { width:100%; }
    .nft-inventory-link { flex:1; }
}
@media (max-width:460px) {
    .garam-nft-page .nft-add-fields { grid-template-columns:minmax(0,1fr); }
    .nft-list { grid-template-columns:minmax(0,1fr); }
    .garam-nft-page .garam-filter-hint { min-width:0; }
}
@media (prefers-reduced-motion:reduce) {
    #nftOwnerModal, .nft-list, .garam-nft-page .garam-button, .garam-nft-page .garam-avatar-button,
    .garam-nft-page .garam-avatar-overlay { transition:none; }
}
