* { box-sizing: border-box; }
.hidden { display: none !important; }
#topright {
  position: fixed; top: 12px; right: 12px; z-index: 100;
  display: flex; align-items: center; gap: 8px;
}
#cart-icon {
  position: relative;
  background: white; border: none;
  width: 40px; height: 40px; border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  cursor: pointer; color: #1a1a1a;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.1s, box-shadow 0.15s;
}
#cart-icon:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.18); transform: translateY(-1px); }
#cart-icon .badge {
  position: absolute; top: -4px; right: -4px;
  background: #b91c1c; color: white;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  box-shadow: 0 0 0 2px white;
}
#cart-icon .badge.empty { background: #94a3b8; }
#user-badge {
  display: flex; align-items: center; gap: 8px;
  background: white; padding: 7px 14px 7px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  font-size: 0.85rem; font-weight: 600; color: #1a1a1a;
}
#user-badge.is-anon { color: #777; font-weight: 500; }
#user-badge .dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px white, 0 0 0 3px rgba(0,0,0,0.1);
}
#user-badge .label { line-height: 1; }
#user-badge .role {
  font-size: 0.7rem; color: #888; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-left: 2px;
}
#user-badge .role.admin {
  background: #1a1a1a; color: white;
  padding: 2px 7px; border-radius: 999px;
  font-weight: 700;
}
.card-quick button.cart-q[disabled] { opacity: 0.3; }
@media (max-width: 600px) {
  #topright { top: 8px; right: 8px; gap: 6px; }
  #cart-icon { width: 36px; height: 36px; }
  #cart-icon .badge { min-width: 18px; height: 18px; font-size: 0.68rem; }
  #user-badge { padding: 6px 11px 6px 8px; font-size: 0.78rem; }
  #user-badge .dot { width: 10px; height: 10px; }
  header h1 { padding-right: 150px; }
}

/* === Cart Panel === */
#cart-overlay {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#cart-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }
#cart-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 540px; max-width: 95vw; background: white; z-index: 221;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
#cart-panel:not(.hidden) { transform: translateX(0); }
#cart-panel header {
  padding: 16px 18px 12px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid #f0f1f3;
}
#cart-panel h2 { margin: 0; font-size: 1.15rem; }
.cart-actions { display: flex; gap: 6px; align-items: center; }
.cart-actions button {
  padding: 7px 12px; border: 1px solid #d0d4da; background: white;
  border-radius: 8px; cursor: pointer; font-family: inherit;
  font-size: 0.83rem; color: #333;
}
.cart-actions button:hover { background: #f5f6f8; }
#cart-close {
  width: 32px; height: 32px; padding: 0;
  font-size: 1.4rem; line-height: 1; color: #666;
  border-radius: 50%; border-color: transparent;
}
#cart-close:hover { background: #f5f6f8; color: #1a1a1a; }
.cart-filter {
  display: flex; gap: 12px; padding: 8px 18px;
  border-bottom: 1px solid #f0f1f3;
  font-size: 0.85rem; color: #555;
}
.cart-filter label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
#cart-items {
  flex: 1; overflow-y: auto; padding: 4px 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.cart-empty { color: #999; padding: 30px 16px; text-align: center; font-style: italic; }
.cart-total {
  padding: 14px 18px; border-top: 2px solid #1a1a1a;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1.05rem; font-weight: 700; background: #fafbfc;
}
.ci {
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
  background: white;
}
.ci.in-mine { border-left: 3px solid #047857; }
.ci-head {
  display: flex; gap: 10px; padding: 10px 12px; cursor: pointer;
  align-items: center;
}
.ci-head:hover { background: #f8fafc; }
.ci-thumb {
  width: 60px; height: 60px; object-fit: contain;
  background: #fafafa; border-radius: 6px; flex-shrink: 0;
}
.ci-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 0.7rem;
}
.ci-info { flex: 1; min-width: 0; }
.ci-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ci-meta { display: flex; gap: 8px; align-items: center; font-size: 0.75rem; color: #888; flex-wrap: wrap; }
.ci-meta .vendor { font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.ci-holders { display: flex; gap: 0; align-items: center; }
.ci-holders .vdot {
  width: 12px; height: 12px; border-radius: 50%;
  margin-left: -3px; box-shadow: 0 0 0 1.5px white;
}
.ci-holders .vdot:first-child { margin-left: 0; }
.ci-vote {
  font-size: 0.78rem; font-weight: 700;
  display: flex; gap: 6px;
}
.ci-vote .up { color: #047857; }
.ci-vote .down { color: #b91c1c; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.ci-price { font-weight: 700; font-size: 0.95rem; color: #1a1a1a; }
.ci-toggle {
  background: transparent; border: none; cursor: pointer;
  color: #888; font-size: 1.1rem; padding: 0;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.ci.open .ci-toggle { transform: rotate(180deg); color: #1a1a1a; }
.ci-body {
  padding: 0 14px 14px; border-top: 1px solid #f0f1f3;
  display: none; font-size: 0.85rem;
}
.ci.open .ci-body { display: block; }
.ci-body h4 { margin: 14px 0 6px; font-size: 0.78rem; color: #555; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.ci-body .desc { color: #555; line-height: 1.4; }
.ci-body .specs {
  background: #f8f9fa; border-left: 3px solid #94a3b8;
  padding: 6px 10px; border-radius: 6px;
  white-space: pre-wrap; line-height: 1.4; color: #333;
}
.ci-body .vote-list {
  display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.8rem;
}
.ci-body .vote-list .v {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; background: #f3f4f6; border-radius: 999px;
}
.ci-body .vote-list .v.up { background: #d1fae5; color: #047857; }
.ci-body .vote-list .v.down { background: #fee2e2; color: #b91c1c; }
.ci-body .vote-list .v .dot { width: 8px; height: 8px; border-radius: 50%; }
.ci-body .comments { display: flex; flex-direction: column; gap: 6px; }
.ci-body .comment {
  background: #f8f9fa; padding: 6px 10px; border-radius: 6px;
  border-left: 3px solid var(--c, #94a3b8);
}
.ci-body .comment .head {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.75rem; margin-bottom: 2px;
}
.ci-body .comment .head .who { font-weight: 700; color: #1a1a1a; }
.ci-body .comment .head .when { color: #888; }
.ci-body .comment .text { font-size: 0.82rem; line-height: 1.4; color: #333; white-space: pre-wrap; word-wrap: break-word; }
.ci-body .nothing { color: #999; font-style: italic; font-size: 0.8rem; }
.ci-body .open-link {
  display: inline-block; margin-top: 6px;
  font-size: 0.78rem; color: #0369a1; text-decoration: none;
}
.ci-body .open-link:hover { text-decoration: underline; }
@media (max-width: 700px) {
  #cart-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 100%;
    height: 92vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  #cart-panel:not(.hidden) { transform: translateY(0); }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f6f8;
  color: #1a1a1a;
  margin: 0;
  padding: 16px;
  -webkit-text-size-adjust: 100%;
}
header { max-width: 1400px; margin: 0 auto 16px; }
h1 { font-size: 1.4rem; margin: 0 0 4px; }
.subtitle { color: #666; font-size: 0.85rem; margin: 0 0 14px; }
.filters, .site-filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px;
  max-width: 1400px;
}
.site-filters { gap: 6px; align-items: center; }
.site-filters .label { font-size: 0.78rem; color: #777; margin-right: 2px; }
.filter, .site-filter {
  border: 1px solid #d0d4da; background: white; color: #333;
  padding: 8px 14px; border-radius: 999px; font-size: 0.85rem;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.filter:hover, .site-filter:hover { border-color: #888; }
.filter.active { background: #1a1a1a; color: white; border-color: #1a1a1a; }
.site-filter {
  font-size: 0.78rem; padding: 6px 12px;
  color: #999; text-decoration: line-through; text-decoration-color: #c0c4ca;
}
.site-filter.active {
  background: #e0f2fe; color: #075985; border-color: #7dd3fc;
  text-decoration: none;
}
.grid {
  max-width: 1400px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.card {
  background: white; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.card-img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: contain; background: #fafafa; display: block;
}
.card-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 0.85rem;
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.card-desc {
  font-size: 0.78rem; color: #666; line-height: 1.4; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 8px; }
.price { font-weight: 700; color: #1a1a1a; font-size: 0.95rem; }
.site { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
@media (max-width: 600px) {
  body { padding: 12px; }
  h1 { font-size: 1.2rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
  .card-title { font-size: 0.85rem; }
  .card-desc { font-size: 0.72rem; }
  .filter, .site-filter { padding: 7px 12px; font-size: 0.8rem; }
}

/* === Card overlays === */
.card { cursor: pointer; position: relative; }
.card.in-cart { box-shadow: 0 0 0 2px #047857, 0 4px 12px rgba(4,120,87,0.2); }
.card-img-wrap { position: relative; flex-shrink: 0; }
.rank-badge {
  position: absolute; top: 8px; left: 8px; z-index: 5;
  background: #f59e0b; color: white;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.cart-pill {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  background: rgba(4,120,87,0.95); color: white;
  border-radius: 999px; padding: 4px 9px 4px 7px;
  display: flex; align-items: center; gap: 5px;
  font-weight: 700; font-size: 0.72rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.cart-pill .dots { display: flex; gap: 0; }
.cart-pill .vdot {
  width: 9px; height: 9px; border-radius: 50%;
  margin-left: -3px; box-shadow: 0 0 0 1.5px rgba(4,120,87,0.95);
}
.cart-pill .vdot:first-child { margin-left: 0; }
.vote-pill {
  position: absolute; bottom: 8px; right: 8px; z-index: 5;
  background: rgba(255,255,255,0.95);
  border-radius: 999px; padding: 4px 8px;
  display: flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.vote-pill .up { color: #047857; }
.vote-pill .down { color: #b91c1c; margin-left: 2px; }
.comment-count {
  position: absolute; bottom: 8px; left: 8px; z-index: 5;
  background: rgba(255,255,255,0.95);
  border-radius: 999px; padding: 3px 9px;
  font-size: 0.72rem; font-weight: 600; color: #444;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.card-quick {
  display: flex; gap: 4px; padding: 6px 10px 10px;
  border-top: 1px solid #f0f1f3; background: #fafbfc;
  align-items: center; justify-content: space-between;
}
.card-quick .qbtns { display: flex; gap: 4px; }
.card-quick button {
  border: 1px solid #e5e7eb; background: white;
  width: 32px; height: 30px; padding: 0;
  border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: #555; font-family: inherit; font-size: 0.78rem;
}
.card-quick button:hover { background: #f5f6f8; border-color: #c0c4ca; }
.card-quick button:disabled { opacity: 0.4; cursor: not-allowed; }
.card-quick button.active { color: white; border-color: transparent; }
.card-quick button.up.active { background: #047857; }
.card-quick button.down.active { background: #b91c1c; }
.card-quick button.cart-q.active { background: #047857; }
.card-quick button.hide-q.active { background: #b91c1c; color: white; }
.card-quick button svg { display: block; }
.card-quick .qrank {
  font-size: 0.72rem; color: #888; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.card-quick .qrank .num {
  display: inline-flex; align-items: center; justify-content: center;
  background: #f59e0b; color: white;
  width: 22px; height: 22px; border-radius: 50%;
  font-weight: 700; font-size: 0.8rem; margin-left: 4px;
}
.card.is-hidden { opacity: 0.55; }
.card.is-deleted {
  opacity: 0.7; cursor: default;
  outline: 2px dashed #b91c1c;
  outline-offset: -2px;
}
.card.is-deleted .card-img { filter: grayscale(0.6) brightness(0.95); }
.card.is-deleted::after {
  content: 'GELOESCHT';
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: #b91c1c; color: white;
  padding: 4px 12px; border-radius: 4px;
  font-weight: 700; font-size: 0.78rem;
  letter-spacing: 1px; z-index: 6;
  pointer-events: none;
}
.restore-q {
  border: 1px solid #047857; background: white; color: #047857;
  font-family: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
}
.restore-q:hover { background: #d1fae5; }
.trash-filter { color: #b91c1c; }
.trash-filter.active { background: #b91c1c; border-color: #b91c1c; color: white; }
.sb-action.danger { color: #b91c1c; border-color: #fecaca; }
.sb-action.danger:hover { background: #fee2e2; }
@media (max-width: 600px) {
  .card-quick { padding: 5px 8px 8px; gap: 3px; }
  .card-quick button { width: 28px; height: 26px; }
  .card-quick .qrank { font-size: 0.68rem; }
}

/* === Toolbar === */
.toolbar {
  max-width: 1400px; margin: 0 auto 12px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  font-size: 0.85rem; color: #555;
}
.toolbar label { display: flex; align-items: center; gap: 6px; }
.toolbar select, .toolbar button {
  padding: 7px 12px; border: 1px solid #d0d4da;
  border-radius: 8px; background: white;
  font-family: inherit; font-size: 0.85rem;
  cursor: pointer; color: #333;
}
.toolbar select { padding: 6px 10px; }
.toolbar button:hover { background: #f5f6f8; }
.toolbar button#add-btn { background: #1a1a1a; color: white; border-color: #1a1a1a; font-weight: 600; }
.toolbar button#add-btn:hover { background: #444; }
.share-wrap { position: relative; }
#share-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  background: white; border: 1px solid #d0d4da; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  min-width: 230px; padding: 4px; max-height: 320px; overflow-y: auto;
}
#share-menu .item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-radius: 6px; cursor: pointer; font-size: 0.85rem;
  border: none; background: transparent; width: 100%; text-align: left;
  font-family: inherit; color: #1a1a1a;
}
#share-menu .item:hover { background: #f5f6f8; }
#share-menu .item .dot {
  width: 10px; height: 10px; border-radius: 50%;
}
#share-menu hr { border: none; border-top: 1px solid #f0f1f3; margin: 4px 0; }
#share-menu .copied {
  font-size: 0.78rem; color: #047857; padding: 4px 12px;
}

/* === Online dots === */
#user-badge .online {
  display: flex; align-items: center; gap: 0;
  padding-left: 8px; margin-left: 4px;
  border-left: 1px solid #e5e7eb;
}
#user-badge .online .odot {
  width: 9px; height: 9px; border-radius: 50%;
  margin-left: -2px; box-shadow: 0 0 0 2px white;
  position: relative;
}
#user-badge .online .odot:first-child { margin-left: 0; }

/* === Add Modal === */
#add-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
#add-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }
#add-modal {
  position: fixed; top: 50%; left: 50%; z-index: 301;
  transform: translate(-50%, -50%);
  background: white; border-radius: 14px;
  width: 480px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  padding: 24px 24px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
#add-modal h2 { margin: 0 0 6px; font-size: 1.2rem; }
#add-modal .add-hint { color: #666; font-size: 0.85rem; margin: 0 0 16px; line-height: 1.4; }
#add-modal label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 0.85rem; color: #555; font-weight: 500; }
#add-modal input {
  padding: 9px 11px; border: 1px solid #d0d4da; border-radius: 8px;
  font-family: inherit; font-size: 0.9rem;
}
#add-modal input:focus { outline: none; border-color: #1a1a1a; }
#add-modal details { margin: 8px 0 12px; }
#add-modal summary { cursor: pointer; font-size: 0.85rem; color: #1a1a1a; padding: 4px 0; user-select: none; }
#add-modal summary:hover { color: #444; }
#add-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  font-size: 1.5rem; cursor: pointer; color: #888;
}
#add-close:hover { color: #1a1a1a; }
.add-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.add-buttons button {
  padding: 9px 16px; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 0.9rem;
  border: 1px solid #d0d4da; background: white;
}
.add-buttons button.primary { background: #1a1a1a; color: white; border-color: #1a1a1a; font-weight: 600; }
.add-buttons button.primary:hover { background: #444; }
.add-buttons button[disabled] { opacity: 0.5; cursor: wait; }
#add-status {
  margin-top: 10px; font-size: 0.85rem; min-height: 18px;
}
#add-status.error { color: #b91c1c; }
#add-status.ok { color: #047857; }

/* === Login + Users modal (re-uses #add-modal styles via shared classes) === */
#login-overlay, #users-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.45); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
#login-overlay:not(.hidden), #users-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }
#login-modal, #users-modal {
  position: fixed; top: 50%; left: 50%; z-index: 301;
  transform: translate(-50%, -50%);
  background: white; border-radius: 14px;
  width: 460px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  padding: 24px 24px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
#users-modal { width: 520px; }
#login-modal h2, #users-modal h2 { margin: 0 0 6px; font-size: 1.2rem; }
#login-modal label, #users-modal label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 0.85rem; color: #555; font-weight: 500; }
#login-modal input, #users-modal input { padding: 9px 11px; border: 1px solid #d0d4da; border-radius: 8px; font-family: inherit; font-size: 0.9rem; }
#login-modal input:focus, #users-modal input:focus { outline: none; border-color: #1a1a1a; }
#login-close, #users-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px; border: none; background: transparent;
  font-size: 1.5rem; cursor: pointer; color: #888;
}
#login-close:hover, #users-close:hover { color: #1a1a1a; }
#login-status, #users-status { margin-top: 10px; font-size: 0.85rem; min-height: 18px; }
#login-status.error, #users-status.error { color: #b91c1c; }
#login-status.ok, #users-status.ok { color: #047857; }

#users-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: #f8f9fa; border-radius: 8px;
}
.user-row .dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.user-row .name { font-weight: 600; flex: 0 0 auto; min-width: 80px; }
.user-row .role-tag {
  font-size: 0.68rem; padding: 2px 8px; border-radius: 999px;
  background: #1a1a1a; color: white; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.user-row .link {
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.74rem;
  color: #666; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-row .row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.user-row button {
  padding: 4px 9px; border: 1px solid #d0d4da; background: white;
  border-radius: 6px; cursor: pointer; font-family: inherit;
  font-size: 0.75rem; color: #333;
}
.user-row button:hover { background: #eef0f3; }
.user-row button.danger { color: #b91c1c; border-color: #fecaca; }
.user-row button.danger:hover { background: #fee2e2; }

/* Login link inside user-badge */
#user-badge .login-link {
  font-size: 0.74rem; color: #0369a1; cursor: pointer;
  margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  background: #e0f2fe; font-weight: 500;
}
#user-badge .login-link:hover { background: #bae6fd; }
#user-badge .logout-link {
  font-size: 0.7rem; color: #888; cursor: pointer;
  margin-left: 4px; text-decoration: underline;
}
#user-badge .logout-link:hover { color: #b91c1c; }
.toolbar #users-btn { background: #fef9e7; border-color: #fcd34d; color: #92400e; font-weight: 600; }
.toolbar #users-btn:hover { background: #fef3c7; }

/* === Sidebar / Bottom Sheet === */
#sidebar-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.45);
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none;
}
#sidebar-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }

#sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 95vw;
  background: white;
  z-index: 201;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
#sidebar:not(.hidden) { transform: translateX(0); }
#sidebar-close {
  position: absolute; top: 8px; right: 12px;
  width: 36px; height: 36px;
  border: none; background: rgba(255,255,255,0.85);
  border-radius: 50%; cursor: pointer;
  font-size: 1.6rem; line-height: 1; color: #333;
  z-index: 10;
}
#sidebar-close:hover { background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
#sidebar-body { overflow-y: auto; height: 100%; padding-bottom: 12px; }

.sb-img {
  width: 100%; aspect-ratio: 4/3;
  background: #fafafa; object-fit: contain; display: block;
}
.sb-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: #999;
}
.sb-section { padding: 14px 18px; border-bottom: 1px solid #f0f1f3; }
.sb-section:last-child { border-bottom: none; }
.sb-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.sb-desc { color: #555; font-size: 0.88rem; line-height: 1.5; margin: 0 0 8px; }
.sb-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 0.78rem; }
.sb-meta .vendor {
  background: #e0f2fe; color: #075985; padding: 3px 9px;
  border-radius: 999px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; font-size: 0.7rem;
}
.sb-meta .cat {
  background: #f3f4f6; color: #555; padding: 3px 9px;
  border-radius: 999px; font-weight: 500;
}
.sb-price { font-size: 1.4rem; font-weight: 700; margin: 8px 0 4px; }
.sb-link {
  display: inline-block; margin-top: 8px;
  background: #1a1a1a; color: white !important;
  padding: 8px 14px; border-radius: 8px;
  text-decoration: none; font-size: 0.85rem; font-weight: 600;
}
.sb-link:hover { background: #444; }

.sb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sb-action {
  padding: 8px 14px; border: 1px solid #d0d4da;
  background: white; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; color: #333;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.sb-action:hover { background: #f5f6f8; }
.sb-action.active { color: white; border-color: transparent; }
.sb-action.upvote.active { background: #047857; }
.sb-action.downvote.active { background: #b91c1c; }
.sb-action.cart.active { background: #047857; }
.sb-action.hide.active { background: #b91c1c; }
.sb-action[disabled] { opacity: 0.4; cursor: not-allowed; }

.sb-rank-row { display: flex; align-items: center; gap: 10px; }
.sb-rank-row label { font-size: 0.85rem; color: #555; font-weight: 500; }
.sb-rank-row select {
  padding: 6px 10px; border: 1px solid #d0d4da; border-radius: 8px;
  background: white; font-family: inherit; font-size: 0.9rem;
  min-width: 90px;
}

.sb-section h3 { margin: 0 0 10px; font-size: 0.85rem; color: #555; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

.comments { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.comment { background: #f8f9fa; padding: 8px 12px; border-radius: 8px; border-left: 3px solid var(--c, #94a3b8); }
.comment .head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 0.78rem; }
.comment .head .who { font-weight: 700; color: #1a1a1a; }
.comment .head .when { color: #888; }
.comment .text { font-size: 0.88rem; line-height: 1.4; color: #333; white-space: pre-wrap; word-wrap: break-word; }
.comment-empty { color: #999; font-size: 0.85rem; font-style: italic; padding: 8px 0; }
.comment .head { justify-content: space-between; }
.comment .head-left { display: flex; align-items: center; gap: 6px; }
.comment .actions {
  display: flex; gap: 4px; opacity: 0;
  transition: opacity 0.15s;
}
.comment:hover .actions, .comment .actions.always { opacity: 1; }
.comment .actions button {
  border: none; background: transparent; cursor: pointer;
  padding: 2px 6px; font-size: 0.78rem; color: #666;
  border-radius: 4px; font-family: inherit;
}
.comment .actions button:hover { background: #e5e7eb; color: #1a1a1a; }
.comment .actions button.danger:hover { background: #fee2e2; color: #b91c1c; }
.comment-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.comment-edit textarea {
  width: 100%; min-height: 50px; padding: 6px 8px;
  border: 1px solid #d0d4da; border-radius: 6px;
  font-family: inherit; font-size: 0.85rem; resize: vertical;
}
.comment-edit .btns { display: flex; gap: 6px; justify-content: flex-end; }
.comment-edit button {
  padding: 4px 12px; border-radius: 6px;
  font-family: inherit; font-size: 0.78rem; cursor: pointer;
  border: 1px solid #d0d4da; background: white;
}
.comment-edit button.primary { background: #1a1a1a; color: white; border-color: #1a1a1a; }

.comment-form { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.comment-form textarea {
  width: 100%; min-height: 60px; padding: 8px 10px;
  border: 1px solid #d0d4da; border-radius: 8px;
  font-family: inherit; font-size: 0.88rem; resize: vertical;
}
.comment-form button {
  align-self: flex-end; padding: 7px 16px;
  background: #1a1a1a; color: white; border: none;
  border-radius: 8px; cursor: pointer; font-family: inherit;
  font-size: 0.85rem; font-weight: 600;
}
.comment-form button:hover { background: #444; }
.comment-form button[disabled] { opacity: 0.5; cursor: not-allowed; }
.anon-hint { font-size: 0.8rem; color: #888; padding: 8px 0; font-style: italic; }

.specs-view {
  background: #f8f9fa; border-left: 3px solid #94a3b8;
  padding: 8px 12px; border-radius: 6px;
  font-size: 0.88rem; color: #333; white-space: pre-wrap;
  line-height: 1.5; min-height: 18px;
}
.specs-view.empty { color: #999; font-style: italic; }
.specs-meta { font-size: 0.74rem; color: #888; margin-top: 4px; }
.specs-edit-row { display: flex; gap: 6px; margin-top: 6px; justify-content: flex-end; }
.specs-edit-row button {
  padding: 5px 12px; border-radius: 6px;
  font-family: inherit; font-size: 0.78rem; cursor: pointer;
  border: 1px solid #d0d4da; background: white;
}
.specs-edit-row button.primary { background: #1a1a1a; color: white; border-color: #1a1a1a; }
.specs-form textarea {
  width: 100%; min-height: 80px; padding: 8px 10px;
  border: 1px solid #d0d4da; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85rem; resize: vertical;
}

@media (max-width: 700px) {
  #sidebar {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 100%;
    height: 90vh; max-height: 90vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  #sidebar:not(.hidden) { transform: translateY(0); }
  #sidebar-close { top: 6px; right: 10px; }
}
