/* 大锤更新速览 (/u/) — 微信极简分享卡片 × 珠光旗舰风（浅 / 深 1:1，320px–1440px 零溢出） */

@font-face {
  font-family: "XinHammer Sans";
  src: url("../assets/fonts/xinhammer-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --u-canvas: #ffffff;
  --u-band: #f5f7fb;
  --u-surface: #ffffff;
  --u-surface-soft: #f6f8fd;
  --u-ink: #0f172a;
  --u-secondary: #4e5a72;
  --u-muted: #78849a;
  --u-border: rgba(15, 23, 42, 0.08);
  --u-border-strong: rgba(15, 23, 42, 0.14);
  --u-obsidian: #111827;
  --u-obsidian-ink: #ffffff;
  --u-cobalt: #2350dc;
  --u-cobalt-soft: rgba(35, 80, 220, 0.1);
  --u-cobalt-border: rgba(35, 80, 220, 0.24);
  --u-amber-bg: #fff7ed;
  --u-amber-ink: #c2410c;
  --u-amber-border: rgba(234, 88, 12, 0.22);
  --u-pm-bg: #eef2ff;
  --u-pm-ink: #3730a3;
  --u-ok-bg: rgba(16, 185, 129, 0.12);
  --u-ok-ink: #047857;
  --u-err-bg: rgba(239, 68, 68, 0.1);
  --u-err-ink: #b91c1c;
  --u-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 12px 32px -16px rgba(15, 23, 42, 0.1);
  --u-shadow-lg: 0 18px 46px -18px rgba(15, 23, 42, 0.22);
  --u-ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--u-canvas);
}

body.u-page {
  margin: 0;
  min-height: 100dvh;
  background: var(--u-band);
  color: var(--u-ink);
  font-family: "XinHammer Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.u-wrap {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  padding-inline: 14px;
}

/* ============================================================
   Slim Frosted Topbar (52px, zero clutter)
   ============================================================ */
.u-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.u-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
}

.u-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.u-brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: radial-gradient(circle at 38% 28%, #ffffff 0%, #ebf1ff 72%, #d8e4ff 100%);
  box-shadow: inset 0 0 0 1px rgba(35, 80, 220, 0.14);
  flex: none;
}

.u-brand-badge img {
  width: 20px;
  height: 20px;
  display: block;
}

.u-brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.u-brand-text strong {
  font-size: 0.95rem;
  font-weight: 740;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.u-brand-text small {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--u-muted);
  white-space: nowrap;
}

.u-top-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.u-top-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--u-border-strong);
  background: rgba(255, 255, 255, 0.9);
  color: var(--u-secondary);
  font-size: 0.78rem;
  font-weight: 620;
  white-space: nowrap;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.u-top-pill:hover {
  border-color: var(--u-cobalt-border);
  color: var(--u-cobalt);
}

.u-top-pill--accent {
  background: var(--u-obsidian);
  border-color: transparent;
  color: var(--u-obsidian-ink);
}

.u-top-pill--accent:hover {
  background: var(--u-cobalt);
  color: #ffffff;
}

/* ============================================================
   Band 1: Pearl-Grid Compact Hero + Edition Switcher
   ============================================================ */
.u-hero-band {
  position: relative;
  overflow: hidden;
  padding: 12px 0 18px;
  background:
    radial-gradient(ellipse 68% 72% at 84% 24%, rgba(69, 120, 255, 0.14), transparent 65%),
    radial-gradient(ellipse 52% 60% at 10% 88%, rgba(255, 194, 88, 0.14), transparent 62%),
    linear-gradient(145deg, #ffffff 10%, #f3f7ff 56%, #f9f7ff 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.u-hero-band::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.032) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 92% 90% at 50% 45%, #000 35%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 92% 90% at 50% 45%, #000 35%, transparent 95%);
}

.u-hero-band > .u-wrap {
  position: relative;
  z-index: 1;
}

.u-edition-strip-wrap {
  position: relative;
  margin-bottom: 10px;
}

.u-edition-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 1px;
  -webkit-overflow-scrolling: touch;
}

.u-edition-strip::-webkit-scrollbar {
  display: none;
}

.u-ed-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--u-border-strong);
  background: rgba(255, 255, 255, 0.88);
  color: var(--u-secondary);
  font-size: 0.8rem;
  font-weight: 620;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s var(--u-ease), color 0.18s var(--u-ease), border-color 0.18s ease, transform 0.14s ease;
}

.u-ed-pill:active {
  transform: scale(0.97);
}

.u-ed-pill.is-active {
  background: var(--u-obsidian);
  border-color: transparent;
  color: var(--u-obsidian-ink);
  box-shadow: 0 6px 16px -8px rgba(15, 23, 42, 0.45);
}

.u-ed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.u-hero-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(35, 80, 220, 0.12);
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: var(--u-shadow);
}

.u-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.u-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--u-amber-bg);
  color: var(--u-amber-ink);
  border: 1px solid var(--u-amber-border);
}

.u-slot-badge--pm {
  background: var(--u-pm-bg);
  color: var(--u-pm-ink);
  border-color: rgba(55, 48, 163, 0.18);
}

.u-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--u-cobalt-soft);
  color: var(--u-cobalt);
  font-size: 0.75rem;
  font-weight: 660;
}

.u-hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 4.4vw, 1.52rem);
  font-weight: 740;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--u-ink);
  text-wrap: balance;
}

.u-hero-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.62;
  color: var(--u-secondary);
}

.u-hero-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--u-muted);
}

.u-hero-count {
  font-weight: 660;
  color: var(--u-secondary);
}

/* ============================================================
   Band 2: Tactile Update Cards
   ============================================================ */
.u-feed-band {
  padding-top: 16px;
}

.u-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
  padding-inline: 2px;
}

.u-section-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 740;
  color: var(--u-ink);
}

.u-section-hint {
  font-size: 0.77rem;
  color: var(--u-muted);
}

.u-cards {
  display: grid;
  gap: 11px;
}

.u-card {
  background: var(--u-surface);
  border: 1px solid var(--u-border);
  border-radius: 18px;
  padding: 14px 15px 12px;
  box-shadow: 0 2px 10px -6px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s var(--u-ease), border-color 0.2s ease, box-shadow 0.2s ease;
}

.u-card--featured {
  border-color: rgba(35, 80, 220, 0.2);
  background: linear-gradient(160deg, #ffffff 0%, #f8faff 100%);
}

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

.u-card-enter {
  animation: uCardIn 0.28s var(--u-ease) both;
}

.u-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.u-card-id {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.u-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 8px -4px rgba(15, 23, 42, 0.14);
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
}

.u-card-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.u-card-name {
  font-size: 0.96rem;
  font-weight: 740;
  color: var(--u-ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.u-card-tag {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--u-cobalt-soft);
  color: var(--u-cobalt);
  font-size: 0.72rem;
  font-weight: 680;
  white-space: nowrap;
}

.u-card-line {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.52;
  color: var(--u-ink);
  overflow-wrap: anywhere;
}

.u-card-point {
  margin: 5px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--u-secondary);
  overflow-wrap: anywhere;
}

.u-card-actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.055);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.u-act-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--u-border-strong);
  background: var(--u-surface-soft);
  color: var(--u-secondary);
  font-size: 0.8rem;
  font-weight: 640;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s var(--u-ease), background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.u-act-btn:active {
  transform: scale(0.95);
}

.u-act-btn--clap:hover {
  border-color: var(--u-amber-border);
  background: var(--u-amber-bg);
  color: var(--u-amber-ink);
}

.u-act-btn--clap.is-reacted {
  border-color: rgba(234, 88, 12, 0.34);
  background: var(--u-amber-bg);
  color: var(--u-amber-ink);
}

.u-act-btn--feedback:hover {
  border-color: var(--u-cobalt-border);
  background: var(--u-cobalt-soft);
  color: var(--u-cobalt);
}

.u-act-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--u-obsidian);
  color: var(--u-obsidian-ink);
  font-size: 0.8rem;
  font-weight: 660;
  white-space: nowrap;
  transition: transform 0.14s var(--u-ease), background 0.16s ease;
}

.u-act-link:hover {
  background: var(--u-cobalt);
  color: #ffffff;
}

.u-act-link:active {
  transform: scale(0.96);
}

@keyframes uSparkFloat {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.85);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -26px) scale(1.18);
  }
}

.u-clap-spark {
  position: absolute;
  left: 50%;
  top: -4px;
  pointer-events: none;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ea580c;
  animation: uSparkFloat 0.62s var(--u-ease) forwards;
}

/* ============================================================
   Interactive Invitation Card (4-tile 1-tap feedback entry)
   ============================================================ */
.u-invite-card {
  margin-top: 16px;
  border-radius: 22px;
  padding: 18px 16px 15px;
  border: 1px solid rgba(35, 80, 220, 0.15);
  background:
    radial-gradient(ellipse 70% 80% at 92% 10%, rgba(59, 130, 246, 0.1), transparent 64%),
    linear-gradient(160deg, #ffffff 0%, #f4f7ff 100%);
  box-shadow: var(--u-shadow);
}

.u-invite-kicker {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--u-cobalt-soft);
  color: var(--u-cobalt);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.u-invite-head h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 740;
  color: var(--u-ink);
}

.u-invite-head p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--u-secondary);
}

.u-mood-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.u-mood-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 13px;
  border-radius: 15px;
  border: 1px solid var(--u-border-strong);
  background: rgba(255, 255, 255, 0.92);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s var(--u-ease), border-color 0.16s ease, box-shadow 0.16s ease;
}

.u-mood-tile:hover {
  transform: translateY(-2px);
  border-color: var(--u-cobalt-border);
  box-shadow: 0 10px 24px -14px rgba(35, 80, 220, 0.3);
}

.u-mood-tile:active {
  transform: scale(0.97);
}

.u-mood-emoji {
  font-size: 1.18rem;
  line-height: 1;
  margin-bottom: 3px;
}

.u-mood-tile strong {
  font-size: 0.9rem;
  font-weight: 720;
  color: var(--u-ink);
}

.u-mood-tile span:last-child {
  font-size: 0.75rem;
  color: var(--u-muted);
}

.u-invite-foot {
  margin-top: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.u-history-pill {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--u-cobalt-border);
  background: var(--u-cobalt-soft);
  color: var(--u-cobalt);
  font-size: 0.78rem;
  font-weight: 660;
  cursor: pointer;
}

.u-text-link {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 660;
  color: var(--u-cobalt);
}

.u-mini-footer {
  margin-top: 18px;
  padding: 6px 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--u-muted);
}

.u-mini-footer a:hover {
  color: var(--u-cobalt);
}

/* ============================================================
   Floating Thumb-Zone Bottom Dock
   ============================================================ */
.u-dock-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.u-dock {
  pointer-events: auto;
  width: 100%;
  max-width: 652px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 34px -10px rgba(15, 23, 42, 0.24);
}

.u-dock-primary {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: var(--u-obsidian);
  color: var(--u-obsidian-ink);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s var(--u-ease), background 0.16s ease;
}

.u-dock-primary:hover {
  background: var(--u-cobalt);
  color: #ffffff;
}

.u-dock-primary:active {
  transform: scale(0.98);
}

.u-dock-share {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--u-border-strong);
  background: var(--u-surface);
  color: var(--u-ink);
  font-size: 0.84rem;
  font-weight: 660;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s var(--u-ease), border-color 0.16s ease, color 0.16s ease;
}

.u-dock-share:hover {
  border-color: var(--u-cobalt-border);
  color: var(--u-cobalt);
}

.u-dock-share:active {
  transform: scale(0.96);
}

/* Floating Toast */
.u-toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 28px);
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 620;
  box-shadow: 0 10px 26px -8px rgba(15, 23, 42, 0.45);
  transition: opacity 0.2s ease, transform 0.22s var(--u-ease);
}

.u-toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   Slide-Up Interactive Feedback Sheet (<dialog>)
   ============================================================ */
dialog.u-sheet {
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
  max-width: 100%;
  margin: auto 0 0 0;
  max-height: 92dvh;
  overflow: visible;
  color: var(--u-ink);
}

dialog.u-sheet::backdrop {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@keyframes uSheetUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

dialog.u-sheet[open] .u-sheet-panel {
  animation: uSheetUp 0.26s var(--u-ease) both;
}

.u-sheet-panel {
  background: var(--u-surface);
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 44px -12px rgba(15, 23, 42, 0.28);
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.u-sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.16);
  margin: 0 auto 10px;
}

.u-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.u-sheet-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 760;
}

.u-sheet-sub {
  margin: 2px 0 0;
  font-size: 0.79rem;
  color: var(--u-muted);
}

.u-sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--u-border);
  background: var(--u-surface-soft);
  color: var(--u-secondary);
  font-size: 0.96rem;
  cursor: pointer;
  flex: none;
  display: inline-grid;
  place-items: center;
}

.u-sheet-close:hover {
  background: var(--u-border);
  color: var(--u-ink);
}

.u-sheet-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--u-surface-soft);
  margin-bottom: 14px;
}

.u-sheet-tab {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--u-secondary);
  font-size: 0.82rem;
  font-weight: 660;
  cursor: pointer;
}

.u-sheet-tab.is-active {
  background: var(--u-surface);
  color: var(--u-ink);
  box-shadow: 0 2px 8px -4px rgba(15, 23, 42, 0.2);
}

.u-form {
  display: grid;
  gap: 13px;
}

.u-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.u-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.u-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--u-secondary);
}

.u-char-count {
  font-size: 0.74rem;
  color: var(--u-muted);
  font-variant-numeric: tabular-nums;
}

.u-mood-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.u-mood-pill {
  min-height: 36px;
  padding: 0 6px;
  border-radius: 11px;
  border: 1px solid var(--u-border-strong);
  background: var(--u-surface);
  color: var(--u-secondary);
  font-size: 0.8rem;
  font-weight: 660;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.u-mood-pill:hover:not(.is-active) {
  border-color: var(--u-cobalt-border);
  color: var(--u-ink);
}

.u-mood-pill:active {
  transform: scale(0.96);
}

.u-mood-pill.is-active {
  background: var(--u-obsidian);
  border-color: transparent;
  color: var(--u-obsidian-ink);
}

.u-product-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 1px 4px;
  -webkit-overflow-scrolling: touch;
}

.u-product-picker::-webkit-scrollbar {
  display: none;
}

.u-prod-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--u-border-strong);
  background: var(--u-surface);
  color: var(--u-secondary);
  font-size: 0.8rem;
  font-weight: 620;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.u-prod-chip img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  background: #ffffff;
}

.u-prod-chip.is-active {
  border-color: var(--u-cobalt);
  background: var(--u-cobalt-soft);
  color: var(--u-cobalt);
}

.u-textarea,
.u-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--u-border-strong);
  background: var(--u-surface-soft);
  color: var(--u-ink);
  font-size: 16px;
  line-height: 1.5;
  padding: 11px 13px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.u-textarea {
  resize: vertical;
  min-height: 92px;
  max-height: 220px;
}

.u-input {
  min-height: 44px;
}

.u-textarea:focus,
.u-input:focus {
  outline: none;
  background: var(--u-surface);
  border-color: var(--u-cobalt);
  box-shadow: 0 0 0 3px rgba(35, 80, 220, 0.14);
}

.u-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.u-starter-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed var(--u-border-strong);
  background: transparent;
  color: var(--u-secondary);
  font-size: 0.76rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.u-starter-chip:hover {
  border-style: solid;
  border-color: var(--u-cobalt-border);
  background: var(--u-cobalt-soft);
  color: var(--u-cobalt);
}

.u-acct-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--u-ok-bg);
  color: var(--u-ok-ink);
  font-size: 0.74rem;
  font-weight: 660;
}

.u-form-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--u-err-bg);
  color: var(--u-err-ink);
  font-size: 0.82rem;
  font-weight: 620;
}

.u-submit-btn {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--u-obsidian);
  color: var(--u-obsidian-ink);
  font-size: 0.94rem;
  font-weight: 720;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.14s ease, opacity 0.16s ease;
}

.u-submit-btn:hover:not(:disabled) {
  background: var(--u-cobalt);
  color: #ffffff;
}

.u-submit-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.u-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Success Receipt */
.u-success {
  text-align: center;
  padding: 12px 4px 4px;
}

.u-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--u-ok-bg);
  color: var(--u-ok-ink);
  display: grid;
  place-items: center;
}

.u-success h3 {
  margin: 0 0 6px;
  font-size: 1.14rem;
  font-weight: 760;
}

.u-success-desc {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--u-secondary);
}

.u-success-preview {
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--u-border);
  background: var(--u-surface-soft);
  margin-bottom: 16px;
  font-size: 0.84rem;
  color: var(--u-ink);
  overflow-wrap: anywhere;
}

.u-success-preview-meta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--u-cobalt);
  margin-bottom: 4px;
}

.u-success-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.u-btn-primary,
.u-btn-secondary {
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.u-btn-primary {
  border: 0;
  background: var(--u-obsidian);
  color: var(--u-obsidian-ink);
}

.u-btn-secondary {
  border: 1px solid var(--u-border-strong);
  background: var(--u-surface);
  color: var(--u-ink);
}

/* History Panel */
.u-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.u-history-item {
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--u-border);
  background: var(--u-surface-soft);
}

.u-history-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 0.74rem;
}

.u-history-tag {
  font-weight: 700;
  color: var(--u-cobalt);
}

.u-history-status {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--u-ok-bg);
  color: var(--u-ok-ink);
  font-weight: 660;
}

.u-history-msg {
  margin: 0;
  font-size: 0.86rem;
  color: var(--u-ink);
  overflow-wrap: anywhere;
}

.u-history-time {
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--u-muted);
}

.u-history-note {
  margin: 12px 0 2px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--u-muted);
}

/* ============================================================
   Desktop Modal Elevation (>= 640px)
   ============================================================ */
@media (min-width: 40rem) {
  .u-wrap {
    padding-inline: 20px;
  }

  .u-mood-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  dialog.u-sheet {
    max-width: 520px;
    margin: auto;
  }

  .u-sheet-panel {
    border-radius: 24px;
    padding: 18px 22px 22px;
    box-shadow: var(--u-shadow-lg);
  }

  .u-sheet-handle {
    display: none;
  }
}

/* Narrow phone polish (<= 375px / 320px) */
@media (max-width: 23.5rem) {
  .u-brand-text small {
    display: none;
  }

  .u-top-pill {
    padding: 0 8px;
    font-size: 0.74rem;
  }

  .u-mood-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .u-dock-primary {
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .u-dock-share {
    padding: 0 11px;
    font-size: 0.78rem;
  }

  .u-act-btn,
  .u-act-link {
    padding: 0 9px;
    font-size: 0.76rem;
  }
}

/* ============================================================
   1:1 Obsidian Night Dark Mode
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --u-canvas: #0b0f19;
    --u-band: #0b0f19;
    --u-surface: #131b2e;
    --u-surface-soft: #1a243b;
    --u-ink: #f8fafc;
    --u-secondary: #b7c3d9;
    --u-muted: #8494b0;
    --u-border: rgba(255, 255, 255, 0.09);
    --u-border-strong: rgba(255, 255, 255, 0.16);
    --u-obsidian: #f8fafc;
    --u-obsidian-ink: #0b0f19;
    --u-cobalt: #7aa2ff;
    --u-cobalt-soft: rgba(122, 162, 255, 0.16);
    --u-cobalt-border: rgba(122, 162, 255, 0.36);
    --u-amber-bg: rgba(251, 146, 60, 0.15);
    --u-amber-ink: #fdba74;
    --u-amber-border: rgba(251, 146, 60, 0.34);
    --u-pm-bg: rgba(129, 140, 248, 0.16);
    --u-pm-ink: #c7d2fe;
    --u-ok-bg: rgba(16, 185, 129, 0.18);
    --u-ok-ink: #6ee7b7;
    --u-err-bg: rgba(248, 113, 113, 0.16);
    --u-err-ink: #fca5a5;
    --u-shadow: 0 14px 36px -18px rgba(0, 0, 0, 0.7);
  }

  .u-topbar {
    background: rgba(11, 15, 25, 0.84);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .u-brand-badge {
    background: #f8fafc;
  }

  .u-top-pill {
    background: rgba(255, 255, 255, 0.06);
    color: #dbe4f3;
  }

  .u-top-pill--accent {
    background: #f8fafc;
    color: #0b0f19;
  }

  .u-top-pill--accent:hover {
    background: #7aa2ff;
    color: #0b0f19;
  }

  .u-hero-band {
    background:
      radial-gradient(ellipse 68% 72% at 84% 24%, rgba(59, 130, 246, 0.2), transparent 65%),
      radial-gradient(ellipse 52% 60% at 10% 88%, rgba(251, 191, 36, 0.1), transparent 62%),
      linear-gradient(155deg, #0d1424 0%, #10192d 60%, #0b0f19 100%);
    border-bottom-color: rgba(255, 255, 255, 0.07);
  }

  .u-hero-band::before {
    background-image:
      linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  }

  .u-ed-pill {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
  }

  .u-ed-pill.is-active {
    background: #f8fafc;
    color: #0b0f19;
  }

  .u-hero-card {
    background: rgba(19, 27, 46, 0.86);
    border-color: rgba(122, 162, 255, 0.2);
  }

  .u-hero-foot {
    border-top-color: rgba(255, 255, 255, 0.08);
  }

  .u-card--featured {
    background: linear-gradient(160deg, #162038 0%, #1a2540 100%);
    border-color: rgba(122, 162, 255, 0.26);
  }

  .u-card-icon {
    background: #f8fafc;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .u-card-actions {
    border-top-color: rgba(255, 255, 255, 0.07);
  }

  .u-invite-card {
    background:
      radial-gradient(ellipse 70% 80% at 92% 10%, rgba(122, 162, 255, 0.16), transparent 64%),
      linear-gradient(160deg, #131c31 0%, #17223a 100%);
    border-color: rgba(122, 162, 255, 0.22);
  }

  .u-mood-tile {
    background: rgba(11, 15, 25, 0.56);
  }

  .u-dock {
    background: rgba(19, 27, 46, 0.88);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 38px -10px rgba(0, 0, 0, 0.72);
  }

  .u-dock-primary:hover,
  .u-act-link:hover,
  .u-submit-btn:hover:not(:disabled) {
    background: #7aa2ff;
    color: #0b0f19;
  }

  .u-toast {
    background: rgba(248, 250, 252, 0.94);
    color: #0b0f19;
  }

  .u-sheet-handle {
    background: rgba(255, 255, 255, 0.22);
  }

  .u-sheet-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .u-sheet-tab.is-active {
    background: #23314f;
  }

  .u-mood-pill {
    background: var(--u-surface-soft);
  }

  .u-mood-pill.is-active {
    background: #f8fafc;
    color: #0b0f19;
  }

  dialog.u-sheet::backdrop {
    background: rgba(4, 7, 15, 0.7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .u-card-enter,
  .u-clap-spark,
  dialog.u-sheet[open] .u-sheet-panel {
    animation: none !important;
  }

  .u-ed-pill,
  .u-act-btn,
  .u-act-link,
  .u-mood-tile,
  .u-dock-primary,
  .u-dock-share,
  .u-toast {
    transition: none !important;
  }
}
