/* Shared controls use palette tokens in every theme. */
:root { --ui-radius:16px; --ui-control-height:42px; --ui-shadow:0 8px 24px #0002; }
.filter-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding-top:12px; }
.filter-fields label { display:flex; flex-direction:column; gap:6px; min-width:0; color:var(--ink-dim); font-size:12px; }
.filter-fields :is(select,input[type=number]) { box-sizing:border-box; width:100%; min-width:0; min-height:var(--ui-control-height); padding:8px 10px; border-radius:var(--ui-radius); border:1px solid var(--hairline); background:var(--surface); color:var(--ink); }
.portfolio-filters { margin:12px 0; padding:12px; border:1px solid var(--hairline); border-radius:var(--ui-radius); background:var(--surface); }
.portfolio-filters summary { cursor:pointer; color:var(--ink); font-size:13px; font-weight:700; }
.filter-fields .group-toggle { grid-column:1/-1; flex-direction:row; align-items:center; }
.filter-fields input[type=checkbox] { accent-color:var(--bar); width:18px; height:18px; }
.filter-chips { display:flex; flex-wrap:wrap; gap:6px; margin-block:8px; }
.filter-chips button,.refresh-row button,.catalogue-sync button { border:1px solid var(--hairline); border-radius:var(--ui-radius); background:var(--surface); color:var(--ink); padding:8px 10px; font-size:12px; }
.refresh-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:16px; }
#portfolio-refresh-status,.catalogue-sync { font-size:12px; line-height:1.5; color:var(--ink-dim); }
html[data-card-columns] #s-profile #gifts.grouped { grid-template-columns:1fr; }
.portfolio-group { min-width:0; padding:12px; border:1px solid var(--hairline); border-radius:var(--ui-radius); background:var(--surface); }
.portfolio-group summary { display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; font-size:13px; color:var(--ink); }
html[data-card-columns] #gifts .group-gifts { display:grid; grid-template-columns:repeat(var(--card-columns),minmax(0,1fr)); gap:10px; row-gap:var(--card-row-gap); margin-top:12px; }
.gift .glyph[data-animation-state=loading]::after { content:''; position:absolute; inset:20%; border:2px solid var(--hairline); border-top-color:var(--bar); border-radius:50%; animation:poster-spin 1s linear infinite; pointer-events:none; }
.gift .glyph[data-animation-state=error]::after { content:'↻'; position:absolute; inset:20%; display:grid; place-items:center; color:var(--ink); font-size:26px; background:var(--surface); border-radius:50%; }
@keyframes poster-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .gift .glyph[data-animation-state=loading]::after { animation:none; } }

/* Preserve pinch zoom while removing accidental double-tap zoom. */
html,body,button,a,input,select,summary,.gift{touch-action:manipulation;}
html body #go-list li.op-wait{display:block;grid-column:1/-1;width:100%;min-height:0;line-height:1.6;overflow-wrap:normal;color:var(--ink-dim);}
html body #go-list:has(.op-wait)::before{display:none;}
#s-profile .profile-avatar-row{position:relative;width:100%;display:flex;justify-content:center;align-items:center;}
html body #s-profile .hero .profile-reactions{position:relative;left:auto;right:auto;top:auto;bottom:auto;margin:10px auto 0;width:max-content;max-width:100%;min-width:74px;min-height:42px;height:auto;box-sizing:border-box;padding:8px 12px;border:1px solid var(--hairline);border-radius:20px;z-index:1;background:var(--surface);box-shadow:none;}
html body #s-profile .hero .profile-reactions:not(.collapsed){width:100%;height:auto;margin-top:12px;padding:12px;border-radius:20px;}
html body #s-profile .hero .reaction-heading-icon{width:18px;height:18px;}
html body #s-profile .hero .reaction-heading b{display:none;}
html body #s-profile .hero .reaction-head{gap:6px;}
html body #s-profile .hero .reaction-collapse{width:40px;height:40px;}
html body #s-profile>.value-history{margin-top:20px;}
.catalogue-intro{padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:20px;margin:20px 0 12px;}
.catalogue-intro>b{font-size:24px;}.catalogue-intro p{margin:8px 0 0;line-height:1.5;color:var(--ink-dim);font-size:13px;}
html body #value-history #pc-last{color:var(--ink);font-size:20px;line-height:1.3;}

/* A single compact hit target; avatar and reactions never share horizontal space. */
html body #s-profile .hero .profile-reactions.collapsed .reaction-head{display:grid;grid-template-columns:14px max-content 14px;justify-content:center;align-items:center;gap:5px;height:24px;}
html body #s-profile .hero .profile-reactions.collapsed .reaction-heading-icon{width:14px;height:24px;background:transparent;color:#ff9966;border-radius:0;}
html body #s-profile .hero .profile-reactions.collapsed .reaction-heading-icon svg{width:14px;height:14px;}
html body #s-profile .hero .profile-reactions.collapsed #reaction-total{max-width:58px;padding:0;background:transparent;color:inherit;font-size:11px;line-height:24px;overflow:hidden;text-overflow:ellipsis;}
html body #s-profile .hero .profile-reactions.collapsed .reaction-collapse{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:inherit;background:transparent;color:inherit;}
html body #s-profile .hero .profile-reactions.collapsed .reaction-collapse svg{position:absolute;right:12px;top:50%;width:12px;height:12px;transform:translateY(-50%) rotate(-90deg);}
html body #s-profile .hero .reaction-collapse:focus-visible{outline:2px solid var(--bar);outline-offset:3px;}

html body #s-profile .hero .profile-reactions.collapsed{color:#ffb186;border-color:#ff986840;background:linear-gradient(135deg,#382218,#291d17);}
html[data-theme="light"] body #s-profile .hero .profile-reactions.collapsed,
html[data-theme="pink"] body #s-profile .hero .profile-reactions.collapsed{color:#a7461c;border-color:#f4ba92;background:linear-gradient(135deg,#fff0e4,#ffe6d5);}
html[data-theme="light"] body #s-profile .hero .profile-reactions.collapsed .reaction-heading-icon,
html[data-theme="pink"] body #s-profile .hero .profile-reactions.collapsed .reaction-heading-icon{color:#d5672e;}

/* Expanded reactions have a proper heading and a captioned total. */
html body #s-profile .hero .profile-reactions.collapsed .reaction-total-full,
html body #s-profile .hero .profile-reactions:not(.collapsed) .reaction-total-short{display:none;}
html body #s-profile .hero .profile-reactions:not(.collapsed) .reaction-head{display:grid;grid-template-columns:minmax(0,1fr) 40px;grid-template-rows:auto auto;column-gap:8px;row-gap:2px;align-items:center;}
html body #s-profile .hero .profile-reactions:not(.collapsed) .reaction-heading{grid-column:1;grid-row:1;gap:8px;}
html body #s-profile .hero .profile-reactions:not(.collapsed) .reaction-heading b{display:block;color:var(--ink);font-size:14px;line-height:20px;}
html body #s-profile .hero .profile-reactions:not(.collapsed) .reaction-heading-icon{width:28px;height:28px;border-radius:9px;border:1px solid #ff996632;background:#ff996615;color:#ff9966;}
html body #s-profile .hero .profile-reactions:not(.collapsed) .reaction-heading-icon svg{width:18px;height:18px;}
html body #s-profile .hero .profile-reactions:not(.collapsed) #reaction-total{grid-column:1;grid-row:2;justify-self:start;margin-left:36px;padding:0;background:transparent;color:var(--ink-dim);font-size:11px;font-weight:600;line-height:18px;}
html body #s-profile .hero .profile-reactions:not(.collapsed) .reaction-collapse{grid-column:2;grid-row:1 / 3;width:40px;height:40px;border-radius:12px;border-color:#ff996632;background:#ff996615;color:#ff9966;}
html[data-theme="light"] body #s-profile .hero .profile-reactions:not(.collapsed) :is(.reaction-heading-icon,.reaction-collapse),
html[data-theme="pink"] body #s-profile .hero .profile-reactions:not(.collapsed) :is(.reaction-heading-icon,.reaction-collapse){color:#b95827;border-color:#edb18b;background:#fff0e4;}

.sale-link{color:inherit;text-decoration:none;cursor:pointer;touch-action:manipulation;}.sale-link:focus-visible{outline:2px solid var(--bar);outline-offset:3px;}.sale-link:hover{border-color:var(--bar);}
