/* NanE — components */

/* ===== Toast ===== */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--on-accent);
  font-weight: var(--fw-heavy);
  line-height: 1.5;
  cursor: pointer;
  animation: toastIn var(--motion-base) var(--motion-spring);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  transform-origin: top right;
}

.toast-out {
  animation: toastOut var(--motion-fast) ease forwards;
}

.toast-icon {
  flex-shrink: 0;
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-size: 16px;
  margin-top: 1px;
}

.toast-msg {
  flex: 1;
  min-width: 0;
}

.toast-close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0px;
  font-weight: var(--fw-heavy);
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast-success {
  background: #3d7a33;
  color: #fff;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

/* ===== Motion Layer ===== */
.motion-ready {
  opacity: 0;
  transition:
    opacity var(--motion-slow) var(--motion-ease),
    transform var(--motion-slow) var(--motion-ease),
    filter var(--motion-slow) var(--motion-ease),
    box-shadow var(--motion-base) var(--motion-ease),
    background var(--motion-base) var(--motion-ease),
    color var(--motion-base) var(--motion-ease);
  transition-delay: calc(var(--motion-index, 0) * var(--motion-stagger));
  will-change: opacity, transform;
}

.motion-ready:not(.motion-visible) {
  transform: translate3d(0, var(--motion-distance, 18px), 0);
  filter: blur(2px);
}

.motion-visible {
  opacity: 1;
}

.item-card.motion-ready,
.skeleton-card.motion-ready {
  animation: none;
}

/* ===== Chips & Segments ===== */
.chips {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 0 var(--space-xs);
}

#filterChips {
  z-index: 3000;
  isolation: isolate;
}

#filterChips.has-building-filter {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.chip-group-label {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: var(--muted);
  letter-spacing: 0.05em;
  padding: 0 4px 0 10px;
  flex-shrink: 0;
}

.chip-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  border-radius: 1px;
  flex-shrink: 0;
  margin: 0 4px;
}

.chips-sub {
  padding-top: 4px;
  padding-bottom: 4px;
}

.chip-sub {
  font-size: 12px;
  min-height: 44px;
  padding: 0 12px;
}

.chip,
.segment {
  min-width: 0;
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  color: var(--muted);
  font-weight: var(--fw-heavy);
  font-size: 13px;
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(139, 111, 175, 0.08);
  transition: background var(--motion-fast), color var(--motion-fast), transform var(--motion-fast) ease, box-shadow var(--motion-fast);
}

.chips > .chip {
  width: 100%;
}

.chip:active {
  transform: scale(0.92);
}

.list-dirty {
  animation: listSlideIn var(--motion-base) var(--motion-ease);
}

@keyframes listSlideIn {
  from { opacity: 0.6; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chip:hover {
  background: rgba(255, 255, 255, 0.6);
}

.chip.active,
.segment.active {
  background: rgba(110, 0, 101, 0.8);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  color: #fff;
  box-shadow:
    inset 0 0 16px rgba(255, 255, 255, 0.1),
    0 4px 16px rgba(110, 0, 101, 0.22);
}

.chip-select {
  position: relative;
  min-height: auto;
  padding: 0;
  flex-shrink: 1;
}

.chip-select-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: none;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font-weight: inherit;
  font-size: inherit;
  cursor: pointer;
}

.chip-chevron {
  font-size: 10px;
  transition: transform var(--motion-base) var(--motion-ease);
}

.chip-select.open .chip-chevron {
  transform: rotate(180deg);
}

.chip-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 4000;
  width: max-content;
  min-width: max(100%, 156px);
  max-width: min(220px, calc(100vw - 44px));
  max-height: min(320px, calc(100vh - 180px));
  list-style: none;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(180, 165, 210, 0.5);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(1.24);
  -webkit-backdrop-filter: blur(24px) saturate(1.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 20px 52px rgba(76, 58, 111, 0.2),
    0 4px 12px rgba(76, 58, 111, 0.08);
  overflow-y: auto;
  transform-origin: top left;
  animation: dropdownPop var(--motion-fast) var(--motion-ease);
}

.chip-select.open {
  z-index: 4001;
}

.chip-dropdown[hidden] {
  display: none;
}

.chip-dropdown li {
  position: relative;
  padding: 11px 34px 11px 14px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: var(--fw-bold);
  color: var(--text-strong);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.chip-building-select .chip-dropdown {
  left: auto;
  right: 0;
  width: min(640px, calc(100vw - 44px));
  max-width: min(640px, calc(100vw - 44px));
  max-height: min(520px, calc(100vh - 180px));
  padding: 10px;
}

.chip-dropdown li:hover {
  background: rgba(110, 0, 101, 0.08);
  color: var(--purple);
}

.chip-dropdown li.selected {
  background: linear-gradient(135deg, rgba(110, 0, 101, 0.14), rgba(110, 0, 101, 0.07));
  color: var(--purple);
  font-weight: var(--fw-black);
}

.chip-dropdown li.selected::after {
  content: "\f00c";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-size: 11px;
}

@keyframes dropdownPop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chip-building-select .building-campus-all {
  display: inline-flex;
  align-items: center;
  margin: 0 0 8px;
  padding: 10px 14px;
}

.chip-building-select .building-campus-group {
  padding: 12px;
  border-radius: 16px;
  background: rgba(246, 242, 249, 0.72);
  cursor: default;
  white-space: normal;
}

.chip-building-select .building-campus-group + .building-campus-group {
  margin-top: 8px;
}

.chip-building-select .building-campus-group:hover {
  background: rgba(246, 242, 249, 0.72);
  color: var(--text-strong);
}

.building-campus-title {
  margin: 0 0 9px;
  color: var(--purple);
  font-size: 12px;
  font-weight: var(--fw-black);
  line-height: 1.2;
}

.building-campus-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-dropdown .building-option {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(110, 0, 101, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.68);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Notice ===== */
.notice-line {
  margin: 18px 0 28px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--muted);
  font-weight: var(--fw-bold);
  line-height: 1.55;
}

/* ===== Cards ===== */
.state-card,
.card,
.item-card,
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 32px 20px;
}

.empty-state-icon {
  color: var(--muted);
  opacity: 0.45;
  margin-bottom: 16px;
  line-height: 1;
}

.empty-state-msg {
  color: var(--muted);
  font-weight: var(--fw-heavy);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== Dialog Animations ===== */
#detailDialog,
#claimsModal,
#reviewDialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  max-width: 520px;
  width: min(520px, calc(100vw - 24px));
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

#detailDialog[open],
#claimsModal[open],
#reviewDialog[open] {
  animation: dialogIn var(--motion-base) var(--motion-spring);
}

#detailDialog::backdrop,
#claimsModal::backdrop,
#reviewDialog::backdrop {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: backdropIn var(--motion-base) ease;
}

#detailDialog.is-closing,
#claimsModal.is-closing,
#reviewDialog.is-closing {
  animation: dialogOut var(--motion-fast) ease forwards;
}

@keyframes dialogOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.92); }
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Contact skeleton in detail */
.skeleton-text {
  height: 14px;
  border-radius: 4px;
  background: var(--line);
  animation: textShimmer 1.2s ease-in-out infinite;
  margin: 4px 0;
}

.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-text.w-40 { width: 40%; }

@keyframes textShimmer {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* ===== Skeleton Cards ===== */
.skeleton-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: var(--space-xl);
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.skeleton-icon {
  width: 104px;
  height: 104px;
  border-radius: var(--radius-xl);
  background: linear-gradient(90deg, var(--line) 25%, var(--card) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 18px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--line) 25%, var(--card) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.w-60 { width: 60%; }
.w-80 { width: 80%; }
.w-40 { width: 40%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Item card entrance */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.item-card {
  animation: fadeInUp var(--motion-base) var(--motion-ease) both;
}

.item-card:nth-child(1) { animation-delay: 0.04s; }
.item-card:nth-child(2) { animation-delay: 0.07s; }
.item-card:nth-child(3) { animation-delay: 0.10s; }
.item-card:nth-child(4) { animation-delay: 0.13s; }
.item-card:nth-child(5) { animation-delay: 0.16s; }
.item-card:nth-child(6) { animation-delay: 0.19s; }

/* ===== Item List & Cards ===== */
.item-list {
  display: grid;
  gap: 6px;
}

.load-more-btn {
  margin-top: var(--space-lg);
}

.load-more-btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.item-card {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: var(--space-xl);
  align-items: center;
  padding: 20px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: opacity var(--motion-fast), padding-left var(--motion-base) var(--motion-ease), transform var(--motion-fast), background var(--motion-fast);
  will-change: transform, opacity;
}

.item-card:hover {
  opacity: 1;
  padding-left: 6px;
  background: rgba(255, 255, 255, 0.18);
}

.item-card:active {
  opacity: 0.6;
  padding-left: 2px;
  transform: scale(0.995);
}

.item-card.is-pressing {
  transform: scale(0.995);
}

.item-card:last-child {
  border-bottom: none;
}

.item-icon {
  width: 104px;
  height: 104px;
  border-radius: var(--radius-xl);
  background: var(--purple-soft);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Font Awesome 7 Free";
  font-size: 36px;
  font-weight: var(--fw-heavy);
}

.item-media {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--purple-soft);
}

.item-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform var(--motion-base) var(--motion-ease), filter var(--motion-base) var(--motion-ease);
}

.item-card:hover .item-media img {
  transform: scale(1.045);
  filter: saturate(1.08);
}

.item-type-overlay {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--purple);
  color: var(--on-accent);
  font-family: "Font Awesome 7 Free";
  font-size: 12px;
  font-weight: var(--fw-heavy);
}

.item-media.image-failed {
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-media.image-failed .item-type-overlay {
  position: static;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 30px;
}

.detail-icon {
  margin: 0 auto 14px;
}

.item-main {
  min-width: 0;
}

.item-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}

.item-title-row h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: var(--fw-heavy);
  color: var(--text);
}

.item-location {
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
  font-weight: var(--fw-bold);
}

.item-desc {
  margin: var(--space-xs) 0 var(--space-md);
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
  font-weight: var(--fw-normal);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  color: var(--muted);
  font-size: 12px;
}

.owner-mini {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-weight: var(--fw-bold);
}

.owner-avatar {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 12px;
  font-weight: var(--fw-black);
}

.trust-mini-badge {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--purple);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: var(--fw-heavy);
  white-space: nowrap;
}

.item-footer time {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ===== Badges ===== */
.badges {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.badge {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: var(--fw-heavy);
}

.badge.purple,
.badge-medicine {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--purple-soft);
}

.badge-consumable {
  border-color: #4a7c59;
  color: #4a7c59;
  background: rgba(74, 124, 89, 0.08);
}

.badge-tool {
  border-color: #5b7a9a;
  color: #5b7a9a;
  background: rgba(91, 122, 154, 0.08);
}

.badge-qty {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(110, 0, 101, 0.06);
  font-weight: 600;
}

.badge.warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge.success {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success-text);
}

.badge.urgency-warn {
  border-color: #e6a817;
  background: #fff8e1;
  color: #8d6a00;
}

.badge.urgency-critical {
  border-color: #d93025;
  background: #fce8e6;
  color: #c62828;
  animation: pulseUrgency 1.5s ease-in-out infinite;
}

.badge.expired-badge {
  border-color: #d93025;
  background: #fce8e6;
  color: #c62828;
}

.item-expired {
  opacity: 0.62;
}

@keyframes pulseUrgency {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Card remove animation */
.card-removing {
  animation: cardRemove 0.35s ease forwards;
  pointer-events: none;
}

@keyframes cardRemove {
  from { opacity: 1; transform: scale(1); max-height: 300px; }
  to { opacity: 0; transform: scale(0.92); max-height: 0; margin: 0; padding: 0; overflow: hidden; }
}

.claim-confirmed {
  background: #3d7a33 !important;
  color: #fff !important;
  border-color: #3d7a33 !important;
  pointer-events: none;
}

/* ===== Claim Panel ===== */
.claim-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 242, 0.82);
}

.claim-title {
  margin-bottom: 10px;
  color: var(--purple);
  font-size: 14px;
  font-weight: var(--fw-bold);
}

.claim-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-weight: var(--fw-bold);
  line-height: 1.45;
}

.claim-row + .claim-row {
  margin-top: 10px;
}

.claim-actions {
  display: flex;
  gap: var(--space-sm);
  flex: 0 0 auto;
}

.claim-button {
  margin-top: var(--space-md);
}

#contactButton.contact-viewed {
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid transparent;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

/* ===== Claim Banner ===== */
.claim-banner {
  margin-bottom: 20px;
  padding: 20px var(--space-xl);
  background: rgba(110, 0, 101, 0.06);
  border-color: var(--purple);
}

.claim-banner-head {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: 14px;
}

.claim-banner-head h3 {
  margin: 0;
  font-size: 20px;
  color: var(--purple);
}

.claim-banner-head span {
  padding: var(--space-xs) 10px;
  border-radius: var(--radius-pill);
  background: var(--purple);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: var(--fw-heavy);
}

.claim-banner-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--line);
}

.claim-banner-row:first-of-type {
  border-top: none;
}

.claim-banner-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.claim-banner-info strong {
  font-size: 15px;
}

.claim-banner-info span {
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--fw-normal);
}

.review-banner {
  margin-bottom: 20px;
  padding: 20px var(--space-xl);
  background: rgba(37, 115, 90, 0.08);
  border-color: #25735a;
}

.review-banner .claim-banner-head h3 {
  color: #25735a;
}

.review-banner .claim-banner-head span {
  background: #25735a;
}

.review-banner-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--line);
}

.review-banner-row .claim-actions {
  flex: 0 0 auto;
}

.review-banner-row:first-of-type {
  border-top: none;
}

.trust-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.trust-count {
  color: #25735a;
  font-weight: var(--fw-heavy);
}

.trust-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trust-tag {
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(37, 115, 90, 0.12);
  color: #25735a;
  font-size: 12px;
  font-weight: var(--fw-heavy);
}

.trust-muted {
  color: var(--muted);
}

.trust-card {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid rgba(37, 115, 90, 0.24);
  border-radius: var(--radius-md);
  background: rgba(37, 115, 90, 0.07);
}

.trust-card-head {
  display: flex;
  gap: var(--space-sm);
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.trust-card-head strong {
  color: var(--text);
  font-size: 14px;
}

.trust-card-head span {
  color: #25735a;
  font-size: 13px;
  font-weight: var(--fw-heavy);
}

.trust-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.profile-trust-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: -12px 0 20px;
  padding: 14px 18px;
  border: 1px solid rgba(37, 115, 90, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(37, 115, 90, 0.07);
}

.profile-trust-stats {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--fw-bold);
}

.profile-trust-stats strong {
  color: #25735a;
  font-size: 18px;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.detail-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--purple-soft);
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  border-radius: var(--radius-md);
}

.image-preview-list.is-dragover {
  outline: 2px dashed var(--purple);
  outline-offset: 4px;
  background: var(--purple-soft);
}

.image-empty {
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13px;
}

.image-upload-progress {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--fw-bold);
}

.image-progress-track {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--purple-soft);
}

.image-progress-track div {
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
  animation: imageProgress 1s ease-in-out infinite;
}

@keyframes imageProgress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(260%); }
}

.image-preview {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--purple-soft);
}

.image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(31, 42, 36, 0.78);
  color: #fff;
  box-shadow: none;
}

.review-dialog {
  width: min(520px, calc(100% - 24px));
}

.review-target {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.review-target span {
  color: var(--muted);
  font-size: 14px;
}

.review-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-md);
}

.review-tag {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.review-tag.active {
  border-color: #25735a;
  background: #25735a;
  color: #fff;
}

#reviewCommentInput {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: var(--space-md);
}

/* ===== Owner Actions ===== */
.owner-actions {
  display: flex;
  gap: 10px;
  margin-top: var(--space-lg);
}

/* ===== Claims Modal ===== */
.claims-modal {
  width: min(560px, calc(100% - 24px));
}

.claim-modal-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.claim-modal-row + .claim-modal-row {
  border-top: 1px solid var(--line);
}

.claim-modal-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.claim-modal-info strong {
  font-size: 16px;
}

.claim-modal-info span {
  color: var(--muted);
  font-size: 14px;
  font-weight: var(--fw-normal);
}

.disabled-claim {
  background: #a09b91 !important;
  cursor: default;
  box-shadow: none;
}

/* ===== Confirm Dialog ===== */
.confirm-dialog {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 420px;
  width: 90vw;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 24px 70px rgba(28, 20, 44, 0.22),
    0 4px 16px rgba(28, 20, 44, 0.08);
  animation: dialogIn var(--motion-base) var(--motion-spring);
}

.confirm-dialog::backdrop {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: backdropIn var(--motion-base) ease;
}

.confirm-dialog-content {
  padding: var(--space-xl);
}

.confirm-dialog-content > p {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.7;
}

.confirm-input {
  width: 100%;
  margin: 2px 0 16px;
}

.confirm-input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: var(--fw-heavy);
}

.confirm-input input {
  width: 100%;
}

.confirm-input-hint {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--fw-bold);
}

.confirm-dialog-content h3 {
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--text-strong);
}

.confirm-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.confirm-label {
  color: var(--muted);
  flex-shrink: 0;
}

.confirm-actions {
  display: grid;
  gap: 8px;
}

.confirm-actions .primary {
  width: 100%;
}

.confirm-actions .secondary {
  width: 100%;
}

@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== Dialog ===== */
dialog {
  width: min(620px, calc(100% - 24px));
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
}

dialog[open] {
  animation: dialogIn var(--motion-base) var(--motion-spring);
}

dialog::backdrop {
  background: rgba(31, 31, 31, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: backdropIn var(--motion-base) ease;
}

#agreementDialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(20px) saturate(0.8);
  -webkit-backdrop-filter: blur(20px) saturate(0.8);
}

dialog.is-closing {
  animation: dialogOut var(--motion-fast) ease forwards;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: 14px;
}

.dialog-head h3 {
  margin: 0;
  font-size: 26px;
}

/* ===== Detail View ===== */
.detail-meta {
  margin: 14px 0;
  color: var(--muted);
  line-height: 1.7;
  font-weight: var(--fw-bold);
}

.contact-box {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--purple-soft);
  color: var(--purple);
  line-height: 1.6;
}

.contact-field {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-weight: var(--fw-heavy);
}

.contact-field + .contact-field {
  margin-top: 6px;
}

.contact-label {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: var(--fw-bold);
  opacity: 0.7;
  min-width: 2.2em;
}

.contact-value {
  font-size: 15px;
}


.contact-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--fw-bold);
}

/* ===== Agreement Dialog ===== */
.agreement-dialog {
  width: min(760px, calc(100% - 24px));
}

.agreement-body {
  max-height: min(68vh, 720px);
  overflow: auto;
  padding-right: var(--space-sm);
  color: var(--muted);
  line-height: 1.75;
  font-weight: var(--fw-normal);
}

.agreement-body h1,
.agreement-body h2,
.agreement-body h3 {
  color: var(--text);
  line-height: 1.25;
}

.agreement-body h1 {
  font-size: 26px;
}

.agreement-body h2 {
  margin-top: 26px;
  font-size: 21px;
}

.agreement-body h3 {
  margin-top: 18px;
  font-size: 17px;
}

.agreement-list {
  margin-left: 1em;
}

/* ===== Guest Publish ===== */
.guest-publish-icon {
  font-family: "Font Awesome 7 Free";
  font-size: 52px;
  color: var(--purple);
  margin-bottom: 12px;
  font-weight: var(--fw-heavy);
}

/* ===== Dark Mode (components) ===== */
[data-theme="dark"] .chip,
[data-theme="dark"] .segment {
  background: var(--card);
  color: var(--muted);
  border-color: var(--line);
}

[data-theme="dark"] dialog {
  background: var(--card-strong);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .badge {
  background: var(--card);
  color: var(--text);
}

[data-theme="dark"] .badge-consumable {
  color: #7dba92;
  background: rgba(125, 186, 146, 0.12);
}

[data-theme="dark"] .badge-medicine {
  color: var(--accent);
  background: var(--purple-soft);
}

[data-theme="dark"] .badge-tool {
  color: #92b4d4;
  background: rgba(146, 180, 212, 0.12);
}

[data-theme="dark"] .confirm-dialog {
  background: var(--card-strong);
  color: var(--text);
  border-color: var(--line);
}

[data-theme="dark"] .confirm-dialog::backdrop {
  background: rgba(3, 2, 7, 0.72);
}

[data-theme="dark"] .claim-title {
  color: var(--accent);
}

[data-theme="dark"] .claim-panel {
  background: var(--card-strong);
  border-color: var(--line);
}

[data-theme="dark"] .claim-banner {
  background: var(--purple-soft);
  border-color: var(--purple-glow);
}

[data-theme="dark"] .contact-box {
  background: var(--purple-soft);
  color: var(--text-strong);
  border-color: var(--purple-glow);
}

[data-theme="dark"] #contactButton.contact-viewed {
  background: var(--purple-soft);
  color: var(--text-strong);
}

[data-theme="dark"] .claim-banner-head h3 {
  color: var(--accent);
}

[data-theme="dark"] .notice-line {
  background: var(--card);
}

[data-theme="dark"] .chip.active,
[data-theme="dark"] .segment.active {
  border-color: var(--purple);
  background: var(--purple);
  color: var(--on-accent);
}

[data-theme="dark"] .skeleton-icon,
[data-theme="dark"] .skeleton-line {
  --shimmer-mid: rgba(255, 255, 255, 0.09);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
}

[data-theme="dark"] .badge.urgency-warn {
  border-color: #8d6a00;
  background: #3d2e00;
  color: #fdd835;
}

[data-theme="dark"] .badge.urgency-critical,
[data-theme="dark"] .badge.expired-badge {
  border-color: #c62828;
  background: #3e1212;
  color: #f28b82;
}

[data-theme="dark"] .item-expired {
  opacity: 0.5;
}

[data-theme="dark"] .toast-close {
  background: rgba(255,255,255,0.12);
}

[data-theme="dark"] .claim-confirmed {
  background: #2e5a24 !important;
}

[data-theme="dark"] .guest-publish-icon {
  color: var(--accent);
}

[data-theme="dark"] .chip-dropdown {
  background: rgba(21, 19, 32, 0.94);
  border-color: var(--line);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 38px rgba(0, 0, 0, 0.46);
}

[data-theme="dark"] .chip-dropdown li {
  color: var(--text-strong);
}

[data-theme="dark"] .chip-dropdown li:hover {
  background: var(--hover);
  color: var(--accent);
}

[data-theme="dark"] .chip-dropdown li.selected {
  background: linear-gradient(135deg, rgba(216, 140, 232, 0.2), rgba(216, 140, 232, 0.1));
  color: var(--accent);
}

[data-theme="dark"] .chip-building-select .building-campus-group {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
}

[data-theme="dark"] .chip-building-select .building-campus-group:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-strong);
}

[data-theme="dark"] .building-campus-title {
  color: var(--accent);
}

[data-theme="dark"] .chip-dropdown .building-option {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
}

[data-theme="dark"] .item-card:hover {
  background: var(--card-strong);
  border-color: var(--purple-glow);
}

[data-theme="dark"] .trust-card {
  background: rgba(37, 115, 90, 0.12);
  border-color: rgba(37, 115, 90, 0.2);
}

[data-theme="dark"] .trust-card-head strong {
  color: var(--text-strong);
}

[data-theme="dark"] .review-tag {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
  color: var(--text-strong);
}

[data-theme="dark"] .review-tag.active {
  border-color: #25735a;
  background: rgba(37, 115, 90, 0.5);
  color: #fff;
}

/* Notification center */
[data-theme="dark"] .notification-panel {
  background: var(--card-strong);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .notification-panel .dialog-head {
  background: rgba(31, 28, 45, 0.96);
  border-color: var(--line);
}
[data-theme="dark"] .notif-badge {
  background: #dc3545;
  color: #fff;
}
[data-theme="dark"] .notif-item {
  border-color: var(--line);
}
[data-theme="dark"] .notif-item:hover {
  background: var(--hover);
}
[data-theme="dark"] .notif-body strong {
  color: var(--text);
}
[data-theme="dark"] .notif-empty {
  color: var(--muted);
}

/* Activity feed */
[data-theme="dark"] .activity-item {
  background: var(--card);
  border-color: var(--line);
}
[data-theme="dark"] .activity-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
[data-theme="dark"] .activity-item .act-title {
  color: var(--text);
}

/* Onboarding */
[data-theme="dark"] .onboarding-card {
  background: var(--card-strong);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .onboard-step p {
  color: var(--muted);
}
[data-theme="dark"] .onboard-dot {
  background: rgba(255, 255, 255, 0.18);
}
[data-theme="dark"] .onboard-dot.active {
  background: var(--accent);
}

/* PWA install banner */
[data-theme="dark"] .install-banner {
  background: var(--card-strong);
  border-color: var(--line);
  box-shadow: 0 -14px 34px rgba(0,0,0,0.36);
}

/* Quantity badge */
[data-theme="dark"] .badge-qty {
  background: rgba(110, 0, 101, 0.12);
  border-color: rgba(186, 130, 182, 0.4);
  color: #c5a3c3;
}

/* Building filter chips */
[data-theme="dark"] .chips-building .chip {
  border-color: var(--line);
  color: var(--muted);
}
[data-theme="dark"] .chips-building .chip.active {
  background: var(--purple-soft);
  border-color: var(--purple-glow);
  color: var(--text-strong);
}

/* ===== Responsive: ≤680px ===== */
@media (max-width: 680px) {
  .app-shell {
    padding: var(--space-xl) var(--space-lg) 96px;
  }

  .brand h1 {
    font-size: 28px;
  }

  .section-head {
    align-items: stretch;
  }

  .search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 10px;
  }

  .search-row .primary {
    min-width: 0;
    padding: 0 14px;
  }

  .auth-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--space-sm);
  }

  .item-card {
    grid-template-columns: 82px 1fr;
    gap: 14px;
  }

  .item-icon,
  .item-media {
    width: 76px;
    height: 76px;
    border-radius: 20px;
  }

  .item-icon {
    font-size: 28px;
  }

  .item-title-row {
    display: block;
  }

  .item-title-row h3 {
    font-size: 20px;
  }

  .item-location {
    margin-top: 6px;
    white-space: normal;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .icon-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-sm);
  }

  .icon-option {
    min-height: 56px;
    border-radius: 14px;
  }

  .icon-option strong {
    font-size: 20px;
  }

  .icon-more {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .profile-card {
    padding: 22px;
  }

  #dateRow {
    display: block;
  }

  .claim-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .claim-actions {
    width: 100%;
  }

  .claim-actions .small {
    flex: 1;
    min-width: 0;
  }

  .review-banner {
    padding: 20px;
  }

  .review-banner-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .review-banner-row .claim-banner-info {
    width: 100%;
  }

  .review-banner-row .claim-actions {
    width: 100%;
  }

  .review-banner-row .claim-actions .small {
    width: 100%;
  }

  .item-card .owner-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .item-card .owner-actions .small {
    flex: 1;
    min-width: 72px;
  }
}

/* ===== Responsive: ≤480px ===== */
@media (max-width: 480px) {
  .chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
    padding-bottom: 6px;
  }

  #filterChips.has-building-filter {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .chip,
  .chip-select-btn {
    padding: 0 6px;
    font-size: 11.5px;
  }

  .chip-select-btn {
    gap: 3px;
  }

  .chip-building-select .chip-select-btn {
    padding: 0 4px;
  }

  .chip-building-select .chip-dropdown {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    max-height: min(70vh, 560px);
    right: -6px;
    padding: 8px;
  }

  .chip-building-select .building-campus-group {
    padding: 10px;
  }

  .building-campus-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chip-dropdown .building-option {
    padding: 10px 8px;
    font-size: 12px;
  }

  .chip-select:not(.chip-building-select) .chip-dropdown {
    left: 50%;
    right: auto;
    min-width: min(172px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    transform: translateX(-50%);
    transform-origin: top center;
  }

  .chip-select:not(.chip-building-select) .chip-dropdown li {
    padding-right: 32px;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chips-sub {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to right, black 82%, transparent 98%);
    mask-image: linear-gradient(to right, black 82%, transparent 98%);
  }

  .chips-sub::-webkit-scrollbar {
    display: none;
  }

  /* D3: Dialog fullscreen */
  #detailDialog[open],
  #claimsModal[open],
  #reviewDialog[open],
  #agreementDialog[open] {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    margin: 0;
    overflow: hidden;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }

  .confirm-dialog {
    width: 100vw;
    max-width: none;
    border-radius: 0;
    margin: 0;
  }

  /* D5: Detail dialog sticky contact button */
  #detailDialog[open] {
    display: flex;
    flex-direction: column;
  }

  #detailDialog .dialog-head {
    flex-shrink: 0;
    padding: 16px var(--space-lg) 12px;
  }

  #detailBody {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 var(--space-lg) 16px;
  }

  #contactButton {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    z-index: 2;
  }

  #contactResult {
    padding-bottom: 8px;
  }

  /* Claims modal sticky actions */
  #claimsModal[open] {
    display: flex;
    flex-direction: column;
  }

  #claimsModal .dialog-head {
    flex-shrink: 0;
    padding: 16px var(--space-lg) 12px;
  }

  #claimsModalBody {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 var(--space-lg) 16px;
  }

  #reviewDialog[open] {
    display: flex;
    flex-direction: column;
  }

  #reviewDialog .dialog-head {
    flex-shrink: 0;
    padding: 16px var(--space-lg) 12px;
  }

  #reviewDialogBody {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 var(--space-lg) 16px;
  }

  /* Agreement dialog scroll */
  #agreementDialog[open] {
    display: flex;
    flex-direction: column;
  }

  #agreementDialog .dialog-head {
    flex-shrink: 0;
    padding: 16px var(--space-lg) 12px;
  }

  .agreement-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* Confirm dialog scroll */
  .confirm-dialog-content {
    max-height: 100dvh;
    overflow-y: auto;
  }
}

/* ===== Responsive: ≤460px ===== */
@media (max-width: 460px) {
  .app-shell {
    padding-inline: var(--space-md);
  }

  .small {
    min-width: 72px;
    padding-inline: 14px;
    font-size: 14px;
  }

  .search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 10px;
  }

  .search-row .small,
  .search-row .primary {
    width: 100%;
  }

  .auth-row {
    grid-template-columns: 1fr;
  }

  .auth-row > button {
    width: 100%;
  }

  .email-combo span {
    padding-right: var(--space-md);
    font-size: 12px;
  }

  .label-row {
    display: block;
  }

  .inline-check {
    margin-top: var(--space-sm) !important;
  }

  .item-card {
    grid-template-columns: 68px 1fr;
    gap: var(--space-md);
  }

  .item-icon,
  .item-media {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }

  .item-icon {
    font-size: 24px;
  }

  .item-title-row h3 {
    font-size: 18px;
  }

  /* Dialog fullscreen padding */
  #detailDialog .dialog-head,
  #claimsModal .dialog-head,
  #agreementDialog .dialog-head {
    padding: 12px var(--space-md);
  }

  #detailBody,
  #claimsModalBody {
    padding: 0 var(--space-md) 12px;
  }

  /* Owner actions stacking */
  .owner-actions {
    flex-direction: column;
    gap: 8px;
  }

  .owner-actions .small {
    width: 100%;
  }

  /* Toast full-width on mobile */
  #toastContainer {
    left: 12px;
    right: 12px;
    max-width: none;
  }

  /* Profile card compact */
  .profile-card {
    padding: 18px;
    gap: 14px;
  }

  .avatar {
    width: 64px;
    height: 64px;
  }

  .avatar img {
    width: 42px;
    height: 42px;
  }

  .profile-card h2 {
    font-size: 20px;
  }

  /* Segmented control compact */
  .segmented {
    gap: 6px;
  }

  .segment {
    padding: 0 10px;
    font-size: 12px;
    min-height: 44px;
  }

  /* Form card compact */
  .form-card {
    padding: var(--space-md);
  }

  /* Icon grid compact */
  .icon-grid {
    gap: 6px;
  }

  .icon-option {
    min-height: 50px;
    padding: 6px 4px;
  }

  .icon-option strong {
    font-size: 18px;
  }

  /* Claim banner compact */
  .claim-banner {
    padding: 14px var(--space-md);
  }

  .claim-banner-head h3 {
    font-size: 17px;
  }

  .claim-banner-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Footer compact */
  .app-footer {
    padding: var(--space-lg) var(--space-md);
  }

  .footer-slogan {
    font-size: 16px;
  }
}

/* ===== Responsive: ≥1080px ===== */
@media (min-width: 1080px) {
  .app-shell {
    width: min(1120px, 100%);
  }

  .view {
    max-width: 980px;
    margin: 0 auto;
  }
}

/* ===== Notification badge ===== */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #dc3545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

/* ===== Notification panel ===== */
.notification-panel {
  max-width: 420px;
  width: 90vw;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 0;
  overflow: hidden;
}
.notification-panel .dialog-head {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
  border-bottom: 1px solid var(--line);
}
.notif-list {
  overflow-y: auto;
  max-height: 55vh;
  padding: 0;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover {
  background: var(--hover);
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}
.notif-dot.claim_request { background: #f0ad4e; }
.notif-dot.claim_confirmed { background: #28a745; }
.notif-dot.claim_rejected { background: var(--muted); }
.notif-dot.review_needed { background: #6E0065; }
.notif-dot.item_approved { background: #28a745; }
.notif-body { flex: 1; min-width: 0; }
.notif-body strong { display: block; font-size: 14px; margin-bottom: 2px; }
.notif-body span { font-size: 12px; color: var(--muted); display: block; }
.notif-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.notif-empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ===== Activity feed ===== */
.activity-feed {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

#activitySectionHead h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#activitySectionHead h2::before {
  content: "\f14e";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: var(--purple-soft);
  color: var(--purple);
  font-family: "Font Awesome 7 Free";
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.activity-feed:empty { display: none; }
.activity-item {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 260px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--line);
  scroll-snap-align: start;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.activity-item:hover {
  box-shadow: var(--shadow);
}
.activity-item .act-icon {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  line-height: 1;
  color: var(--purple);
  font-size: 18px;
  margin-bottom: 6px;
}
.activity-item .act-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.activity-item .act-meta {
  font-size: 11px;
  color: var(--muted);
}

/* ===== Onboarding overlay ===== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .3s;
}
.onboarding-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 28px;
  max-width: 380px;
  width: 90vw;
  padding: 34px 26px 24px;
  text-align: center;
  box-shadow:
    0 24px 70px rgba(28, 20, 44, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: slideUp .35s var(--ease);
}
.onboard-step { display: none; }
.onboard-step.active { display: block; }
.onboard-icon {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  line-height: 1;
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 16px;
}
.onboard-step h2 { margin: 0 0 8px; font-size: 20px; color: var(--text-strong); }
.onboard-step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.onboard-dots { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 22px 0; }
.onboard-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(123, 107, 160, 0.22); transition: width .2s, background .2s; }
.onboard-dot.active { width: 22px; background: var(--purple); }
.onboard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: center;
}
.onboard-actions button {
  min-width: 0;
  min-height: 48px;
  padding: 0 18px;
  font-size: 15px;
}
.onboard-actions .secondary {
  border: 1px solid rgba(180, 165, 210, 0.34);
  background: rgba(255, 255, 255, 0.72);
}

/* ===== PWA Install banner ===== */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  animation: slideUp .3s var(--ease);
}
.install-banner-inner {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.install-banner-inner > span {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}
.install-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
