/* ============================================================
   CafeDaily consumer layer
   Purchase discovery, journal-style records, city footprint and Agent UI.
   Keeps the Brew Lab palette and type system while shifting the interaction
   rhythm from instrument panels to tickets, timeline entries and map stamps.
   ============================================================ */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.consumer-view {
  --journal-paper: color-mix(in oklab, var(--surface) 90%, var(--crema) 10%);
  --journal-line: color-mix(in oklab, var(--line) 78%, var(--crema) 22%);
  --map-water: color-mix(in oklab, var(--surface-2) 72%, #4f7680 28%);
}

.consumer-view button,
.consumer-view input {
  -webkit-tap-highlight-color: transparent;
}

.consumer-view button:not(.text-action):not(.source-note):active {
  transform: translateY(1px) scale(0.992);
}

.consumer-greeting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.consumer-location,
.section-kicker,
.year-story-kicker,
.journey-year,
.agent-badge {
  font-family: var(--data);
  font-size: 0.58rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.consumer-location {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.consumer-greeting h1 {
  max-width: 12ch;
  font-family: var(--display);
  font-size: clamp(1.85rem, 7vw, 2.25rem);
  font-weight: 600;
  line-height: 1.02;
  text-wrap: balance;
}

.consumer-greeting p {
  max-width: 29rem;
  margin-top: 0.45rem;
  color: var(--ink-dim);
  font-size: 0.82rem;
  line-height: 1.55;
}

.source-note,
.source-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-family: var(--data);
  font-size: 0.52rem;
  line-height: 1.1;
  letter-spacing: 0.03em;
  color: var(--ink-dim);
  background: var(--surface);
  white-space: nowrap;
}

.source-note {
  min-height: 44px;
  flex: none;
}

.source-chip.official { color: var(--sage); border-color: color-mix(in oklab, var(--sage) 54%, var(--line)); }
.source-chip.community { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 54%, var(--line)); }
.source-chip.reference { color: #6585a6; border-color: color-mix(in oklab, #6585a6 54%, var(--line)); }
.source-chip.estimate { color: var(--ink-dim); border-style: dashed; }

.consumer-search-launch,
.consumer-search {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-dim);
  box-shadow: 0 8px 22px -20px rgba(0, 0, 0, 0.45);
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), transform 0.22s var(--ease);
}

.consumer-search-launch {
  padding: 0.7rem 0.85rem;
  text-align: left;
}

.consumer-search-launch span { flex: 1; }
.consumer-search-launch:hover,
.consumer-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 14%, transparent);
}

.consumer-search {
  padding: 0 0.8rem;
  margin-bottom: 0.75rem;
}

.consumer-search input {
  min-width: 0;
  flex: 1;
  height: 46px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 1rem;
}

.consumer-search input::placeholder { color: var(--ink-dim); }

.nearby-hero {
  position: relative;
  margin-top: 0.9rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--journal-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 0%, color-mix(in oklab, var(--crema) 28%, transparent), transparent 34%),
    linear-gradient(145deg, var(--journal-paper), var(--surface));
  box-shadow: var(--shadow);
}

.nearby-hero::after,
.repeat-ticket::before,
.repeat-ticket::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--journal-line);
}

.nearby-hero::after { right: -8px; top: 51%; }

.nearby-hero-top,
.consumer-section-head,
.discover-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--sage);
}

.brand-line {
  margin-top: 1rem;
  font-family: var(--data);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.nearby-hero h2 {
  margin-top: 0.15rem;
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.05;
}

.nearby-hero h2 .data {
  margin-left: 0.25rem;
  color: var(--accent);
  font-size: 1.05rem;
}

.market-one-line {
  margin-top: 0.45rem;
  color: var(--ink-2);
  font-size: 0.78rem;
  line-height: 1.5;
}

.consumer-param-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0.85rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.consumer-param-row > div {
  min-width: 0;
  padding: 0.55rem 0.45rem;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
}

.consumer-param-row span,
.consumer-param-row small {
  display: block;
  overflow: hidden;
  color: var(--ink-dim);
  font-size: 0.52rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consumer-param-row b {
  display: block;
  overflow: hidden;
  margin: 0.12rem 0;
  font-family: var(--data);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consumer-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.5rem;
}

.consumer-actions .btn {
  min-height: 46px;
  justify-content: center;
  padding-inline: 0.7rem;
  font-size: 0.78rem;
}

.consumer-section { margin-top: 1.45rem; }
.consumer-section-head { margin-bottom: 0.7rem; align-items: flex-end; }
.consumer-section-head h2 {
  margin-top: 0.1rem;
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.1;
}

.text-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 650;
  transition: color 0.2s var(--ease);
}

.text-action:hover { color: var(--ink); }

.consumer-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.consumer-metrics > div {
  min-width: 0;
  padding: 0.75rem 0.35rem;
  border-right: 1px solid var(--line);
}

.consumer-metrics > div:last-child { border-right: 0; }
.consumer-metrics strong,
.consumer-metrics span { display: block; }
.consumer-metrics strong { font-size: 0.84rem; white-space: nowrap; }
.consumer-metrics span { margin-top: 0.12rem; color: var(--ink-dim); font-size: 0.54rem; }

.consumer-shop-list { display: flex; flex-direction: column; gap: 0.6rem; }

.consumer-shop-card {
  width: 100%;
  min-height: 94px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), transform 0.22s var(--ease);
}

.consumer-shop-card:hover {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow);
}

.shop-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--accent);
}

.shop-copy { min-width: 0; }
.shop-copy strong,
.shop-copy span,
.shop-copy small { display: block; }
.shop-copy strong { overflow: hidden; font-size: 0.84rem; text-overflow: ellipsis; white-space: nowrap; }
.shop-copy span { margin-top: 0.16rem; color: var(--ink-dim); font-size: 0.66rem; }
.shop-copy small { margin-top: 0.32rem; color: var(--ink-2); font-size: 0.64rem; }

.shop-score { text-align: right; }
.shop-score strong { display: block; font-family: var(--data); color: var(--accent); font-size: 0.78rem; }
.shop-score span { display: block; margin-top: 0.18rem; color: var(--ink-dim); font-size: 0.55rem; }

.year-story-card,
.annual-review-card {
  width: 100%;
  margin-top: 1.45rem;
  border: 1px solid color-mix(in oklab, var(--accent) 42%, var(--line));
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--crema) 20%, var(--surface)), var(--surface));
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.year-story-card { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; }
.year-story-card strong { font-family: var(--display); font-size: 1.05rem; font-weight: 600; }
.year-story-card > span:last-child { display: flex; align-items: center; justify-content: space-between; color: var(--ink-dim); font-size: 0.7rem; }
.year-story-card:hover,
.annual-review-card:hover { box-shadow: var(--shadow-lift); border-color: var(--accent); }

/* Discover map */
.consumer-v-head h2 { font-size: 1.75rem; text-wrap: balance; }
.consumer-filters,
.agent-prompt-row {
  display: flex;
  gap: 0.42rem;
  overflow-x: auto;
  margin: 0 -1.1rem 0.8rem;
  padding: 0.1rem 1.1rem 0.35rem;
  scrollbar-width: none;
}

.consumer-filters::-webkit-scrollbar,
.agent-prompt-row::-webkit-scrollbar { display: none; }

.consumer-filters button,
.agent-prompt-row button {
  min-height: 44px;
  flex: none;
  padding: 0.45rem 0.78rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--surface);
  font-size: 0.74rem;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.consumer-filters button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.city-map {
  position: relative;
  height: 260px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(circle at 70% 20%, color-mix(in oklab, var(--crema) 15%, transparent), transparent 28%),
    linear-gradient(160deg, var(--surface-2), var(--map-water));
}

.map-grid {
  position: absolute;
  inset: 0;
  opacity: 0.48;
  background-image:
    linear-gradient(24deg, transparent 46%, var(--line) 47% 48%, transparent 49%),
    linear-gradient(90deg, transparent 47%, var(--line) 48% 49%, transparent 50%),
    linear-gradient(150deg, transparent 46%, var(--line) 47% 48%, transparent 49%);
  background-size: 72px 72px, 58px 58px, 92px 92px;
  transform: scale(1.2) rotate(-5deg);
}

.city-map::before {
  content: '';
  position: absolute;
  top: -16%;
  bottom: -14%;
  left: 74%;
  width: 38px;
  border-inline: 1px solid color-mix(in oklab, #6e9ca8 70%, var(--line));
  background: color-mix(in oklab, #6e9ca8 24%, transparent);
  transform: rotate(10deg);
}

.district-label {
  position: absolute;
  z-index: 1;
  font-family: var(--data);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.district-label.jingan { left: 34%; top: 22%; }
.district-label.xuhui { left: 22%; top: 68%; }
.district-label.huangpu { left: 56%; top: 62%; }
.district-label.pudong { right: 5%; top: 48%; }

.map-pin {
  position: absolute;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  border: 1px solid var(--accent);
  border-radius: 50% 50% 50% 14px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 7px 18px -8px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) rotate(-45deg);
  transition: transform 0.24s var(--ease), background-color 0.24s var(--ease), color 0.24s var(--ease);
}

.map-pin > span { display: grid; place-content: center; transform: rotate(45deg); }
.map-pin.visited { border-style: solid; background: var(--accent); color: var(--accent-ink); }
.map-pin:not(.visited) { border-style: dashed; }
.map-pin:hover { transform: translate(-50%, -54%) rotate(-45deg) scale(1.06); }
.map-pin.filtered { display: none; }

.map-legend {
  position: absolute;
  z-index: 2;
  left: 0.65rem;
  bottom: 0.65rem;
  display: flex;
  gap: 0.6rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  font-size: 0.58rem;
  color: var(--ink-2);
}

.map-legend span { display: inline-flex; align-items: center; gap: 0.28rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--accent); }
.legend-dot.lit { background: var(--accent); }
.legend-dot.new { border-style: dashed; background: var(--surface); }

.discover-status { min-height: 44px; color: var(--ink-dim); font-size: 0.68rem; }
.discover-status .text-action { padding: 0; }

/* Journal and record interactions */
.journal-primary-actions { display: flex; flex-direction: column; gap: 0.65rem; }

.journal-tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.65rem; }
.journal-tool {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--accent);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.journal-tool:hover { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--surface)); }
.journal-tool:active { transform: translateY(1px); }
.journal-tool span { min-width: 0; }
.journal-tool strong,
.journal-tool small { display: block; }
.journal-tool strong { color: var(--ink); font-size: 0.7rem; white-space: nowrap; }
.journal-tool small { margin-top: 0.16rem; color: var(--ink-dim); font-size: 0.56rem; }

.slogan-card {
  position: relative;
  margin-top: 0.65rem;
  padding: 0.82rem 0.9rem 0.7rem;
  border: 1px solid color-mix(in oklab, var(--crema) 55%, var(--line));
  border-radius: 14px;
  background: var(--journal-paper);
  box-shadow: var(--shadow);
}
.slogan-card::before,
.slogan-card::after { content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 1px solid var(--journal-line); top: 50%; transform: translateY(-50%); }
.slogan-card::before { left: -7px; }
.slogan-card::after { right: -7px; }
.slogan-card-kicker { color: var(--accent); font-family: var(--data); font-size: 0.55rem; letter-spacing: 0.08em; }
.slogan-card p { margin-top: 0.35rem; color: var(--ink); font-family: var(--display); font-size: 1.02rem; line-height: 1.45; }
.slogan-card .text-action { margin-top: 0.35rem; padding: 0; font-size: 0.62rem; }

.record-main-cta,
.agent-capture-card,
.pro-entry-card {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), transform 0.22s var(--ease);
}

.record-main-cta {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--line));
  background: linear-gradient(135deg, color-mix(in oklab, var(--crema) 18%, var(--surface)), var(--surface));
}

.record-main-cta:hover,
.agent-capture-card:hover,
.pro-entry-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.record-main-icon,
.agent-capture-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  border-radius: 13px;
  background: var(--accent);
  color: var(--accent-ink);
}

.agent-capture-icon { background: var(--surface-2); color: var(--accent); border: 1px dashed var(--accent); }
.record-main-cta strong,
.record-main-cta small,
.agent-capture-card strong,
.agent-capture-card small,
.pro-entry-card strong,
.pro-entry-card small { display: block; }
.record-main-cta strong,
.agent-capture-card strong,
.pro-entry-card strong { font-size: 0.87rem; }
.record-main-cta small,
.agent-capture-card small,
.pro-entry-card small { margin-top: 0.15rem; color: var(--ink-dim); font-size: 0.64rem; line-height: 1.4; }

.agent-badge {
  padding: 0.2rem 0.38rem;
  border-radius: 6px;
  background: color-mix(in oklab, var(--accent) 13%, transparent);
}

.repeat-ticket {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.8rem;
  padding: 0.9rem 1rem;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--journal-paper);
  text-align: left;
}

.repeat-ticket::before { left: -8px; top: 50%; }
.repeat-ticket::after { right: -8px; top: 50%; }
.ticket-brand { grid-column: 1; font-family: var(--data); color: var(--accent); font-size: 0.58rem; letter-spacing: 0.08em; }
.ticket-drink { grid-column: 1; font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.ticket-meta { grid-column: 1; display: flex; gap: 0.7rem; margin-top: 0.15rem; color: var(--ink-dim); font-family: var(--data); font-size: 0.58rem; }
.ticket-action { grid-column: 2; grid-row: 1 / 4; align-self: center; display: inline-flex; align-items: center; gap: 0.3rem; color: var(--accent); font-size: 0.66rem; font-weight: 650; }

.journal-timeline { position: relative; display: flex; flex-direction: column; gap: 0.72rem; }
.journal-timeline::before {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 23px;
  width: 1px;
  background: var(--journal-line);
}

.journal-entry {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 0.68rem;
  animation: journal-entry-in 0.42s var(--ease) both;
}

.journal-entry:nth-child(2) { animation-delay: 60ms; }
.journal-entry:nth-child(3) { animation-delay: 120ms; }
.journal-entry:nth-child(4) { animation-delay: 180ms; }

.journal-date {
  z-index: 1;
  width: 46px;
  height: 46px;
  display: grid;
  place-content: center;
  border: 1px solid var(--journal-line);
  border-radius: 50%;
  background: var(--bg);
  font-family: var(--data);
  font-size: 0.54rem;
  color: var(--ink-dim);
  text-align: center;
  line-height: 1.15;
}

.journal-ticket {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.journal-ticket::before,
.journal-ticket::after { content: ''; position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--journal-line); top: 50%; transform: translateY(-50%); }
.journal-ticket::before { left: -7px; }
.journal-ticket::after { right: -7px; }

.journal-ticket:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.journal-ticket-head { display: flex; justify-content: space-between; gap: 0.6rem; }
.journal-ticket-head strong { overflow: hidden; font-size: 0.84rem; text-overflow: ellipsis; white-space: nowrap; }
.journal-ticket-head .data { flex: none; color: var(--accent); font-size: 0.74rem; }
.journal-ticket .drink { margin-top: 0.18rem; color: var(--ink-2); font-size: 0.72rem; }
.journal-ticket .record-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.record-tags span { padding: 0.2rem 0.4rem; border-radius: 6px; background: var(--surface-2); color: var(--ink-dim); font-size: 0.58rem; }
.journal-ticket-foot { display: flex; justify-content: space-between; margin-top: 0.55rem; padding-top: 0.48rem; border-top: 1px dashed var(--line); color: var(--ink-dim); font-size: 0.58rem; }

.section-count { color: var(--ink-dim); font-size: 0.6rem; }
.pro-entry { padding-top: 1rem; border-top: 1px dashed var(--line); }

@keyframes journal-entry-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Shop, product and record sheets */
.store-sheet-hero { padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.store-sheet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.store-sheet-top h3 { font-family: var(--display); font-size: 1.25rem; line-height: 1.1; }
.store-sheet-top p { margin-top: 0.25rem; color: var(--ink-dim); font-size: 0.68rem; }
.store-sheet-score { text-align: right; flex: none; }
.store-sheet-score b { display: block; font-family: var(--data); color: var(--accent); font-size: 1.05rem; }
.store-sheet-score span { display: block; color: var(--ink-dim); font-size: 0.55rem; }
.shop-tag-row,
.sheet-source-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.65rem; }
.shop-tag-row span { padding: 0.25rem 0.45rem; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); font-size: 0.62rem; }

.sheet-section { margin-top: 1rem; }
.sheet-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.55rem; }
.sheet-section-title strong { font-size: 0.88rem; }
.sheet-section-title span { color: var(--ink-dim); font-size: 0.58rem; }

.sentiment-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
.sentiment-bars div { padding: 0.55rem; border-radius: 10px; background: var(--surface-2); }
.sentiment-bars b,
.sentiment-bars span { display: block; }
.sentiment-bars b { font-family: var(--data); font-size: 0.8rem; }
.sentiment-bars span { margin-top: 0.12rem; color: var(--ink-dim); font-size: 0.55rem; }

.product-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}

.product-card + .product-card { margin-top: 0.5rem; }
.product-card strong,
.product-card small { display: block; }
.product-card strong { font-size: 0.83rem; }
.product-card small { margin-top: 0.18rem; color: var(--ink-dim); font-size: 0.62rem; }
.product-card .price { font-family: var(--data); color: var(--accent); font-size: 0.8rem; }
.product-notes { display: flex; gap: 0.28rem; margin-top: 0.45rem; }
.product-notes span { padding: 0.18rem 0.36rem; border-radius: 6px; background: var(--surface-2); font-size: 0.56rem; color: var(--ink-2); }

.parameter-list { display: flex; flex-direction: column; gap: 0.45rem; }
.parameter-row { display: grid; grid-template-columns: 0.8fr 1.2fr auto; align-items: center; gap: 0.5rem; min-height: 42px; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.parameter-row:last-child { border-bottom: 0; }
.parameter-row span:first-child { color: var(--ink-dim); font-size: 0.64rem; }
.parameter-row b { font-size: 0.72rem; }

.consumer-record-form .cui-field { margin-bottom: 0.72rem; }
.record-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.repurchase-scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.repurchase-scale button,
.taste-toggle button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-2);
  background: var(--surface);
  font-size: 0.72rem;
}
.repurchase-scale button[aria-pressed="true"],
.taste-toggle button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 15%, var(--surface)); color: var(--accent); }
.taste-toggle { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.taste-toggle button { padding: 0.35rem 0.6rem; border-radius: 999px; }
.progressive-fields { margin-top: 0.3rem; border-top: 1px dashed var(--line); }
.progressive-fields summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-size: 0.72rem; cursor: pointer; }
.record-save-btn { width: 100%; min-height: 48px; justify-content: center; margin-top: 0.75rem; }

.record-success {
  text-align: center;
  padding: 0.4rem 0 0.2rem;
}
.record-success-mark { width: 62px; height: 62px; display: grid; place-content: center; margin: 0 auto 0.8rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); animation: record-pop 0.5s var(--ease); }
.record-success h3 { font-family: var(--display); font-size: 1.35rem; }
.record-success p { margin-top: 0.5rem; color: var(--ink-dim); font-size: 0.76rem; line-height: 1.55; }
.record-success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 1rem; }
.record-success-actions .btn { min-height: 46px; justify-content: center; padding-inline: 0.5rem; font-size: 0.72rem; }
@keyframes record-pop { 0% { transform: scale(0.45); opacity: 0; } 65% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* Journey */
.journey-hero {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid color-mix(in oklab, var(--accent) 45%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 0%, color-mix(in oklab, var(--crema) 34%, transparent), transparent 35%),
    var(--surface);
}

.journey-main-number { display: flex; align-items: baseline; gap: 0.45rem; margin-top: 0.35rem; }
.journey-main-number strong { font-size: 2.5rem; line-height: 1; color: var(--accent); }
.journey-main-number span { font-family: var(--display); font-size: 1rem; }
.journey-hero > p { margin-top: 0.45rem; color: var(--ink-2); font-size: 0.74rem; }
.journey-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px dashed var(--line); }
.journey-kpis b,
.journey-kpis span { display: block; }
.journey-kpis b { font-size: 0.75rem; }
.journey-kpis span { margin-top: 0.1rem; color: var(--ink-dim); font-size: 0.55rem; }

.footprint-map {
  min-height: 160px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.4rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.district-stamp {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.55rem;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-dim);
  background: color-mix(in oklab, var(--surface) 76%, transparent);
}
.district-stamp.lit { border-style: solid; border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); color: var(--ink); background: color-mix(in oklab, var(--crema) 12%, var(--surface)); }
.district-stamp span { font-size: 0.65rem; }
.district-stamp b { font-family: var(--data); font-size: 0.68rem; }
.district-stamp small { color: var(--ink-dim); font-size: 0.52rem; }

.district-progress { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.65rem; }
.district-progress-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 0.5rem; }
.district-progress-row span,
.district-progress-row b { font-size: 0.62rem; }
.district-progress-row b { font-family: var(--data); color: var(--ink-dim); }
.district-progress-row .track { height: 5px; border-radius: 999px; background: var(--ring-track); overflow: hidden; }
.district-progress-row .track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.annual-review-card { display: grid; grid-template-columns: 0.82fr 1.18fr; margin-top: 1.35rem; }
.annual-review-cover { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; padding: 0.9rem; background: var(--espresso); color: var(--paper); }
.annual-review-cover span { font-family: var(--data); color: var(--crema); font-size: 0.56rem; letter-spacing: 0.06em; }
.annual-review-cover strong { font-family: var(--display); font-size: 1rem; font-weight: 600; }
.annual-review-cover strong .data { font-size: 1.8rem; color: var(--crema); }
.annual-review-copy { display: flex; flex-direction: column; justify-content: space-between; padding: 0.9rem; }
.annual-review-copy p { color: var(--ink-2); font-size: 0.7rem; line-height: 1.55; }
.annual-review-copy span { display: flex; align-items: center; justify-content: space-between; color: var(--accent); font-size: 0.66rem; font-weight: 650; }

.memory-grid { display: grid; gap: 0.55rem; }
.memory-grid > div { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 0.15rem 0.65rem; padding: 0.72rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.memory-grid span { grid-row: 1 / 3; align-self: center; font-family: var(--data); color: var(--accent); font-size: 0.57rem; }
.memory-grid strong { font-size: 0.82rem; }
.memory-grid small { color: var(--ink-dim); font-size: 0.62rem; }

.consumer-profile-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.consumer-profile-summary > div { padding: 0.75rem 0.55rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.consumer-profile-summary span,
.consumer-profile-summary small { display: block; }
.consumer-profile-summary span { color: var(--accent); font-size: 1rem; }
.consumer-profile-summary small { margin-top: 0.18rem; color: var(--ink-dim); font-size: 0.56rem; }

/* Agent */
.agent-status-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.agent-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px color-mix(in oklab, var(--sage) 16%, transparent); }
.agent-status-card[data-agent-status="degraded"] .agent-status-dot { background: var(--garnet); box-shadow: 0 0 0 4px color-mix(in oklab, var(--garnet) 16%, transparent); }
.agent-status-card strong,
.agent-status-card small { display: block; }
.agent-status-card strong { font-size: 0.78rem; }
.agent-status-card small { margin-top: 0.12rem; color: var(--ink-dim); font-size: 0.59rem; }

.agent-mode-selector { margin-top: 0.8rem; }
.agent-section-label,
.agent-selection-head,
.agent-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.agent-section-label strong { color: var(--ink); font-size: 0.74rem; }
.agent-section-label > span { color: var(--ink-dim); font-size: 0.56rem; text-align: right; }

.agent-mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.agent-mode-tabs button {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 0.64rem;
  font-weight: 650;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.agent-mode-tabs button:hover { border-color: var(--line-strong); color: var(--ink); }
.agent-mode-tabs button[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 11%, var(--surface));
  color: var(--accent);
}

.agent-upload-card {
  position: relative;
  margin-top: 0.7rem;
  padding: 0.8rem;
  border: 1px solid var(--journal-line);
  border-radius: 16px;
  background: var(--journal-paper);
  box-shadow: 0 12px 28px -26px rgba(0, 0, 0, 0.7);
}
.agent-upload-card::before,
.agent-upload-card::after {
  content: '';
  position: absolute;
  top: 55px;
  width: 12px;
  height: 12px;
  border: 1px solid var(--journal-line);
  border-radius: 50%;
  background: var(--bg);
}
.agent-upload-card::before { left: -7px; }
.agent-upload-card::after { right: -7px; }
.agent-upload-card.is-dragging { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 14%, transparent); }

.agent-dropzone {
  width: 100%;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 0.55rem;
  padding: 0.85rem;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.agent-dropzone:hover,
.agent-dropzone:focus-visible {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 7%, var(--surface));
}
.agent-dropzone-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-content: center;
  flex: none;
  border: 1px solid color-mix(in oklab, var(--accent) 50%, var(--line));
  border-radius: 14px;
  color: var(--accent);
  background: var(--surface);
}
.agent-dropzone > span:last-child { min-width: 0; }
.agent-dropzone strong,
.agent-dropzone small { display: block; }
.agent-dropzone strong { font-size: 0.72rem; line-height: 1.45; }
.agent-dropzone small { margin-top: 0.18rem; color: var(--ink-dim); font-size: 0.56rem; line-height: 1.5; }

.agent-capture-actions,
.agent-recognition-actions,
.agent-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.agent-capture-actions .btn,
.agent-recognition-actions .btn,
.agent-result-actions .btn { min-height: 46px; justify-content: center; padding-inline: 0.5rem; font-size: 0.68rem; }

.agent-selection {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--journal-line);
}
.agent-selection-head span { display: flex; align-items: baseline; gap: 0.4rem; }
.agent-selection-head b { font-size: 0.66rem; }
.agent-selection-head small { font-family: var(--data); color: var(--ink-dim); font-size: 0.52rem; }
.agent-selection-head .text-action { min-height: 44px; padding-inline: 0.4rem; }
.agent-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; margin-top: 0.4rem; }
.agent-preview-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.agent-preview-media { aspect-ratio: 1 / 0.78; display: grid; place-content: center; overflow: hidden; color: var(--ink-dim); background: var(--surface-2); }
.agent-preview-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.agent-preview-copy { min-width: 0; padding: 0.4rem; }
.agent-preview-copy strong,
.agent-preview-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-preview-copy strong { font-size: 0.54rem; }
.agent-preview-copy small { margin-top: 0.12rem; color: var(--ink-dim); font-family: var(--data); font-size: 0.46rem; }
.agent-preview-remove {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  border: 1px solid color-mix(in oklab, var(--line-strong) 80%, transparent);
  border-radius: 50%;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  color: var(--ink);
  backdrop-filter: blur(5px);
}

.agent-note-field { margin-top: 0.75rem; margin-bottom: 0; }
.agent-note-field label { display: flex; justify-content: space-between; gap: 0.5rem; }
.agent-note-field label span { color: var(--ink-dim); font-family: var(--data); font-size: 0.5rem; font-weight: 400; }
.agent-note-field textarea { min-height: 68px; resize: vertical; }

.agent-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding: 0.6rem;
  border-radius: 10px;
  background: color-mix(in oklab, var(--sage) 9%, var(--surface));
  color: var(--sage);
}
.agent-privacy-note > i { flex: none; margin-top: 0.08rem; }
.agent-privacy-note strong,
.agent-privacy-note span { display: block; }
.agent-privacy-note strong { font-size: 0.61rem; }
.agent-privacy-note span { margin-top: 0.12rem; color: var(--ink-dim); font-size: 0.54rem; line-height: 1.5; }

.agent-inline-error {
  margin-top: 0.65rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid color-mix(in oklab, var(--garnet) 58%, var(--line));
  border-radius: 10px;
  background: color-mix(in oklab, var(--garnet) 9%, var(--surface));
  color: var(--garnet);
  font-size: 0.61rem;
  line-height: 1.5;
}
.agent-start-btn:disabled { cursor: not-allowed; opacity: 0.48; box-shadow: none; }
.agent-example-btn:disabled { cursor: wait; opacity: 0.55; }

.agent-recognition-progress {
  margin-top: 0.8rem;
  padding: 0.8rem;
  border: 1px solid color-mix(in oklab, var(--accent) 48%, var(--line));
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.agent-progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.agent-progress-head strong { display: block; margin-top: 0.16rem; font-size: 0.74rem; }
.agent-progress-head button { width: 44px; height: 44px; display: grid; place-content: center; flex: none; border-radius: 11px; color: var(--ink-dim); }
.agent-progress-head button[hidden] { display: none; }
.agent-progress-track { height: 7px; margin-top: 0.65rem; overflow: hidden; border-radius: 99px; background: var(--ring-track); }
.agent-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.3s var(--ease); }
.agent-progress-meta { margin-top: 0.35rem; color: var(--ink-dim); font-size: 0.54rem; }
.agent-progress-meta b { flex: none; font-family: var(--data); color: var(--accent); }
.agent-progress-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.2rem; margin-top: 0.65rem; list-style: none; }
.agent-progress-steps li { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; color: var(--ink-dim); text-align: center; font-size: 0.46rem; }
.agent-progress-steps i { width: 8px; height: 8px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-2); }
.agent-progress-steps li.is-active { color: var(--accent); }
.agent-progress-steps li.is-active i { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 12%, transparent); }
.agent-progress-steps li.is-done { color: var(--ink-2); }
.agent-progress-steps li.is-done i { border-color: var(--sage); background: var(--sage); }

.agent-thread { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.9rem; }
.agent-message { display: flex; align-items: flex-start; gap: 0.55rem; animation: journal-entry-in 0.32s var(--ease); }
.agent-message.user { justify-content: flex-end; }
.agent-avatar { width: 30px; height: 30px; display: grid; place-content: center; flex: none; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); background: var(--surface); }
.agent-message > div { max-width: 84%; padding: 0.68rem 0.75rem; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; background: var(--surface); color: var(--ink-2); font-size: 0.72rem; line-height: 1.55; }
.agent-message.user > div { border-radius: 14px 4px 14px 14px; border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); background: color-mix(in oklab, var(--accent) 12%, var(--surface)); color: var(--ink); }
.agent-message.loading > div { color: var(--ink-dim); }
.agent-message.has-result > div { width: calc(100% - 38px); max-width: calc(100% - 38px); }

.agent-draft { margin-top: 0.55rem; overflow: hidden; border: 1px dashed var(--accent); border-radius: 12px; background: var(--journal-paper); }
.agent-result-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem; border-bottom: 1px dashed var(--journal-line); }
.agent-result-head > div { min-width: 0; }
.agent-result-head .mini-k { display: block; }
.agent-result-head strong { display: block; margin-top: 0.15rem; color: var(--ink); font-size: 0.74rem; }
.agent-confidence {
  --confidence: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-content: center;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, var(--journal-paper) 76%, transparent 78% 99%), conic-gradient(var(--sage) calc(var(--confidence) * 1%), var(--ring-track) 0);
  font-family: var(--data);
  color: var(--ink);
  font-size: 0.52rem;
}
.agent-confidence.is-low { background: radial-gradient(circle closest-side, var(--journal-paper) 76%, transparent 78% 99%), conic-gradient(var(--garnet) calc(var(--confidence) * 1%), var(--ring-track) 0); }
.agent-result-summary { padding: 0.65rem 0.7rem 0; color: var(--ink-2); font-size: 0.62rem; line-height: 1.55; }
.agent-result-fields { display: grid; gap: 0.35rem; padding: 0.6rem 0.7rem; }
.agent-result-field { padding: 0.5rem 0.55rem; border: 1px solid var(--journal-line); border-radius: 9px; background: color-mix(in oklab, var(--surface) 78%, transparent); }
.agent-result-field.is-low { border-style: dashed; border-color: color-mix(in oklab, var(--garnet) 48%, var(--line)); }
.agent-result-field-top { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; align-items: baseline; gap: 0.4rem; }
.agent-result-field-top span { color: var(--ink-dim); font-size: 0.53rem; }
.agent-result-field-top strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-family: var(--data); font-size: 0.59rem; font-weight: 700; }
.agent-result-field-top b { color: var(--sage); font-family: var(--data); font-size: 0.49rem; }
.agent-result-field.is-low .agent-result-field-top b { color: var(--garnet); }
.agent-result-source { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.26rem; color: var(--ink-dim); font-size: 0.49rem; line-height: 1.45; }
.agent-result-source i { width: 4px; height: 4px; flex: none; border-radius: 50%; background: currentColor; }

.agent-parameter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; padding: 0 0.7rem 0.65rem; }
.agent-parameter-grid > div { padding: 0.48rem; border-top: 1px solid var(--journal-line); }
.agent-parameter-grid span,
.agent-parameter-grid b { display: block; }
.agent-parameter-grid span { color: var(--ink-dim); font-size: 0.48rem; }
.agent-parameter-grid b { margin-top: 0.16rem; overflow-wrap: anywhere; color: var(--ink); font-family: var(--data); font-size: 0.54rem; }

.agent-result-section { padding: 0.62rem 0.7rem; border-top: 1px dashed var(--journal-line); }
.agent-result-section > strong { display: block; color: var(--ink); font-size: 0.58rem; }
.agent-candidate-list { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.agent-candidate-list span { padding: 0.3rem 0.42rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 0.49rem; }
.agent-warning-list { display: grid; gap: 0.32rem; margin-top: 0.4rem; padding: 0; list-style: none; }
.agent-warning-list li { position: relative; padding-left: 0.65rem; color: var(--ink-dim); font-size: 0.52rem; line-height: 1.5; }
.agent-warning-list li::before { content: ''; position: absolute; top: 0.48em; left: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--garnet); }
.agent-raw-text summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); cursor: pointer; font-size: 0.55rem; }
.agent-raw-text p { margin: 0 0 0.55rem; padding: 0.5rem; border-radius: 8px; background: var(--surface-2); color: var(--ink-dim); font-family: var(--data); font-size: 0.49rem; line-height: 1.55; }
.agent-result-actions { padding: 0 0.7rem 0.7rem; margin-top: 0; }
.agent-result-actions .btn { width: 100%; }

.recognition-field-hint { display: block; margin-top: 0.25rem; color: var(--sage); font-size: 0.54rem; line-height: 1.45; }
.recognition-field-hint.is-low { color: var(--garnet); }
.recognition-review { margin-bottom: 0.75rem; padding: 0.65rem; border: 1px dashed var(--accent); border-radius: 11px; background: var(--journal-paper); }
.recognition-review strong { display: block; font-size: 0.66rem; }
.recognition-review p { margin-top: 0.22rem; color: var(--ink-dim); font-size: 0.56rem; line-height: 1.5; }

.agent-prompt-row { margin-top: 0.75rem; margin-bottom: 0.45rem; }
.agent-prompt-row button { min-height: 38px; position: relative; }
.agent-prompt-row button::after { content: ''; position: absolute; inset: 50% 0 auto; height: 44px; transform: translateY(-50%); }

.agent-composer { display: flex; align-items: center; gap: 0.45rem; padding: 0.38rem 0.38rem 0.38rem 0.72rem; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.agent-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 13%, transparent); }
.agent-composer input { min-width: 0; flex: 1; min-height: 40px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; }
.agent-composer button { width: 44px; height: 44px; display: grid; place-content: center; flex: none; border-radius: 11px; background: var(--accent); color: var(--accent-ink); }
.agent-boundary { margin-top: 0.85rem; padding: 0.75rem; border-left: 2px solid var(--accent); background: color-mix(in oklab, var(--surface-2) 75%, transparent); }
.agent-boundary p { margin-top: 0.25rem; color: var(--ink-dim); font-size: 0.62rem; line-height: 1.55; }

/* Agent conversation-first surface */
#view-agent { padding-bottom: 0.65rem; }
.agent-head { margin-bottom: 0.55rem; }
.agent-head p { max-width: 32rem; }
.agent-status-inline {
  min-height: 44px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  padding: 0.12rem 0 0.55rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-dim);
}
.agent-status-inline .agent-status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--sage) 14%, transparent);
}
.agent-status-inline[data-agent-status="degraded"] .agent-status-dot {
  background: var(--garnet);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--garnet) 14%, transparent);
}
.agent-status-copy { min-width: 0; display: inline-flex; align-items: baseline; }
.agent-status-copy strong { color: var(--ink-2); font-size: 0.66rem; }
.agent-status-copy small { color: var(--ink-dim); font-size: 0.61rem; }
.agent-privacy-details { margin-left: auto; }
.agent-privacy-details summary,
.agent-result-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 650;
  list-style: none;
}
.agent-privacy-details summary::-webkit-details-marker,
.agent-result-details summary::-webkit-details-marker { display: none; }
.agent-privacy-details summary::after,
.agent-result-details summary::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.agent-privacy-details[open] { width: 100%; margin-left: 0; }
.agent-privacy-details[open] summary::after,
.agent-result-details[open] summary::after { transform: translateY(2px) rotate(225deg); }
.agent-privacy-details p {
  margin-top: 0.15rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-dim);
  font-size: 0.62rem;
  line-height: 1.55;
}

.agent-thread {
  min-height: clamp(13rem, 32vh, 20rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.8rem;
  padding-bottom: 0.25rem;
}
.agent-message { display: flex; align-items: flex-start; gap: 0.5rem; animation: journal-entry-in 0.28s var(--ease); }
.agent-message.user { justify-content: flex-end; }
.agent-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-content: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  background: var(--surface);
}
.agent-message > div {
  max-width: 86%;
  padding: 0.7rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 4px 15px 15px 15px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.74rem;
  line-height: 1.55;
}
.agent-message.user > div {
  border-radius: 15px 4px 15px 15px;
  border-color: color-mix(in oklab, var(--accent) 44%, var(--line));
  background: color-mix(in oklab, var(--accent) 11%, var(--surface));
  color: var(--ink);
}
.agent-inline-action,
.agent-retry-action,
.agent-cancel-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 650;
}
.agent-inline-action { margin: 0.15rem 0 -0.55rem; }
.agent-inline-action:hover,
.agent-retry-action:hover,
.agent-cancel-action:hover { color: var(--ink); }
.agent-inline-action:disabled,
.agent-retry-action:disabled { cursor: wait; opacity: 0.48; }

.agent-message.user.has-image > div { width: min(74%, 250px); padding: 0.3rem; }
.agent-user-image {
  min-height: 116px;
  display: grid;
  place-content: center;
  overflow: hidden;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-dim);
}
.agent-user-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.agent-user-image.is-file { gap: 0.35rem; padding: 0.75rem; text-align: center; }
.agent-user-image.is-file span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6rem; }
.agent-message.user.has-image p { padding: 0.45rem 0.4rem 0.25rem; font-size: 0.68rem; line-height: 1.45; }

.agent-message.loading > div { width: min(80%, 285px); color: var(--ink-dim); }
.agent-loading-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.agent-loading-copy p { color: var(--ink-2); }
.agent-loading-copy span { flex: none; font-family: var(--data); color: var(--accent); font-size: 0.58rem; }
.agent-inline-progress { height: 4px; margin-top: 0.55rem; overflow: hidden; border-radius: 99px; background: var(--ring-track); }
.agent-inline-progress span { display: block; width: 4%; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.28s var(--ease); }
.agent-cancel-action { margin-bottom: -0.55rem; }
.agent-cancel-action[hidden] { display: none; }
.agent-message.loading.is-error .agent-loading-copy p,
.agent-message.loading.is-error .agent-loading-copy span { color: var(--garnet); }
.agent-message.loading.is-error .agent-inline-progress span { background: var(--garnet); }
.agent-message.loading.is-cancelled .agent-inline-progress span { background: var(--ink-dim); }

.agent-prompt-row { margin-top: 0.55rem; margin-bottom: 0.25rem; }
.agent-prompt-row button { min-height: 44px; padding-inline: 0.7rem; font-size: 0.68rem; }
.agent-prompt-row button::after { display: none; }

.agent-composer-shell {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 0 -0.3rem;
  padding: 0.5rem 0.3rem 0.2rem;
  border-top: 1px solid color-mix(in oklab, var(--line) 82%, transparent);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  box-shadow: 0 -14px 24px -24px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
}
.agent-composer-shell.is-dragging .agent-composer {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 13%, transparent);
}
.agent-selection { margin: 0 0 0.45rem; padding: 0; border: 0; }
.agent-preview-grid { display: block; margin: 0; }
.agent-preview-item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 8px 18px -18px rgba(0, 0, 0, 0.55);
}
.agent-preview-media {
  width: 56px;
  height: 52px;
  aspect-ratio: auto;
  display: grid;
  place-content: center;
  overflow: hidden;
  border-radius: 9px;
  color: var(--ink-dim);
  background: var(--surface-2);
}
.agent-preview-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.agent-preview-copy { min-width: 0; padding: 0; }
.agent-preview-copy strong,
.agent-preview-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-preview-copy strong { color: var(--ink); font-size: 0.65rem; }
.agent-preview-copy small { margin-top: 0.16rem; color: var(--ink-dim); font-family: var(--data); font-size: 0.55rem; }
.agent-preview-remove {
  position: static;
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-dim);
  backdrop-filter: none;
}
.agent-preview-remove:hover { color: var(--garnet); background: color-mix(in oklab, var(--garnet) 8%, transparent); }
.agent-composer {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 10px 24px -22px rgba(0, 0, 0, 0.7);
}
.agent-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 13%, transparent); }
.agent-composer input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.agent-composer input::placeholder { color: var(--ink-dim); }
.agent-composer button {
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  flex: none;
  border-radius: 11px;
}
.agent-composer .agent-attach { color: var(--accent); background: var(--surface-2); }
.agent-composer .agent-send { color: var(--accent-ink); background: var(--accent); }
.agent-composer button:hover:not(:disabled) { filter: brightness(1.04); }
.agent-composer button:disabled { cursor: not-allowed; opacity: 0.4; filter: none; }
.agent-composer input:disabled { cursor: wait; opacity: 0.62; }
.agent-composer-hint { display: block; margin: 0.28rem 0.25rem 0; color: var(--ink-dim); font-size: 0.58rem; line-height: 1.45; }
.agent-inline-error { margin-top: 0.4rem; padding: 0.6rem 0.65rem; font-size: 0.62rem; }

.agent-message.has-result > div { width: calc(100% - 38px); max-width: calc(100% - 38px); }
.agent-draft { margin-top: 0.55rem; overflow: hidden; border: 1px dashed var(--accent); border-radius: 13px; background: var(--journal-paper); }
.agent-result-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.45rem; padding: 0.65rem 0.7rem; border-bottom: 1px dashed var(--journal-line); }
.agent-result-head .mini-k { color: var(--accent); }
.agent-confidence {
  width: auto;
  height: auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border: 1px solid color-mix(in oklab, var(--sage) 50%, var(--line));
  border-radius: 999px;
  background: color-mix(in oklab, var(--sage) 8%, var(--journal-paper));
  color: var(--sage);
  font-family: var(--data);
  font-size: 0.55rem;
}
.agent-confidence.is-low {
  border-color: color-mix(in oklab, var(--garnet) 50%, var(--line));
  background: color-mix(in oklab, var(--garnet) 8%, var(--journal-paper));
  color: var(--garnet);
}
.agent-result-summary { padding: 0.72rem 0.72rem 0.35rem; }
.agent-result-summary > strong,
.agent-result-summary > span { display: block; }
.agent-result-summary > strong { overflow-wrap: anywhere; color: var(--ink); font-family: var(--display); font-size: 0.98rem; font-weight: 650; line-height: 1.25; }
.agent-result-summary > span { margin-top: 0.2rem; overflow-wrap: anywhere; color: var(--ink-2); font-size: 0.66rem; }
.agent-result-alert { margin-top: 0.5rem; padding-left: 0.55rem; border-left: 2px solid var(--sage); color: var(--ink-dim); font-size: 0.6rem; line-height: 1.5; }
.agent-result-alert.is-low { border-left-color: var(--garnet); color: var(--garnet); }
.agent-result-actions { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; padding: 0.45rem 0.7rem 0.35rem; }
.agent-result-actions .btn { width: 100%; min-height: 46px; justify-content: center; padding-inline: 0.65rem; font-size: 0.68rem; }
.agent-result-actions .agent-retry-action { justify-self: center; }
.agent-result-details { border-top: 1px dashed var(--journal-line); }
.agent-result-details > summary { justify-content: space-between; padding: 0 0.72rem; }
.agent-result-detail-body { border-top: 1px dashed var(--journal-line); }
.agent-result-fields { display: grid; gap: 0.38rem; padding: 0.65rem 0.7rem; }
.agent-result-field { padding: 0.52rem 0.56rem; }
.agent-result-field-top { grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 0.4rem; }
.agent-result-field-top span { font-size: 0.6rem; }
.agent-result-field-top strong { font-size: 0.64rem; }
.agent-result-field-top b { font-size: 0.56rem; }
.agent-result-source { margin-top: 0.3rem; font-size: 0.56rem; }
.agent-parameter-grid { gap: 0.35rem; padding: 0 0.7rem 0.65rem; }
.agent-parameter-grid span { font-size: 0.55rem; }
.agent-parameter-grid b { font-size: 0.6rem; }
.agent-result-section { padding: 0.65rem 0.7rem; }
.agent-result-section > strong { font-size: 0.62rem; }
.agent-candidate-list span { font-size: 0.56rem; }
.agent-warning-list li { font-size: 0.58rem; }
.agent-raw-text p { margin: 0.45rem 0 0; font-size: 0.56rem; }

.year-review-sheet { text-align: center; }
.year-review-sheet .cover-number { margin: 0.55rem 0; font-family: var(--data); font-size: 3.2rem; color: var(--accent); line-height: 1; }
.year-review-sheet h3 { font-family: var(--display); font-size: 1.4rem; }
.year-review-sheet > p { margin: 0.6rem auto 0; max-width: 30rem; color: var(--ink-2); font-size: 0.76rem; line-height: 1.6; }
.year-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 1rem; text-align: left; }
.year-review-grid div { padding: 0.7rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.year-review-grid span,
.year-review-grid b { display: block; }
.year-review-grid span { color: var(--ink-dim); font-size: 0.56rem; }
.year-review-grid b { margin-top: 0.18rem; font-size: 0.76rem; }

.export-sheet-preview { padding: 0.72rem; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--journal-paper); }
.export-sheet-preview strong,
.export-sheet-preview span { display: block; }
.export-sheet-preview strong { font-family: var(--data); color: var(--accent); font-size: 0.82rem; }
.export-sheet-preview span { margin-top: 0.25rem; color: var(--ink-dim); font-size: 0.62rem; line-height: 1.5; }
.export-sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.8rem; }
.export-sheet-actions .btn { min-height: 46px; justify-content: center; padding-inline: 0.45rem; }
.prompt-preference-sheet .cui-seg-in { margin-top: 0.25rem; }
.prompt-preference-sheet .preference-hint { margin-top: 0.28rem; color: var(--ink-dim); font-size: 0.61rem; line-height: 1.5; }
.prompt-preference-sheet .cui-field { margin-bottom: 0.85rem; }
.prompt-preference-sheet textarea { min-height: 88px; }
.prompt-preference-sheet .taste-toggle button { min-height: 40px; }

@media (max-width: 390px) {
  .journal-tool-row { grid-template-columns: 1fr; }
}

/* Interaction offsets: the old home had a sticky AI bar; the consumer home does not. */
.device[data-view="home"] .cui-toasts {
  bottom: calc(var(--tabbar-h, 61px) + env(safe-area-inset-bottom) + 0.5rem);
}

@media (max-width: 390px) {
  .consumer-param-row { grid-template-columns: 1fr; }
  .consumer-param-row > div { display: grid; grid-template-columns: 0.75fr 0.8fr 1fr; align-items: center; gap: 0.35rem; }
  .consumer-param-row b { margin: 0; }
  .consumer-actions { grid-template-columns: 1fr; }
  .consumer-metrics { grid-template-columns: 1fr 1fr; }
  .consumer-metrics > div:nth-child(2) { border-right: 0; }
  .consumer-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .annual-review-card { grid-template-columns: 1fr; }
  .annual-review-cover { min-height: 104px; }
  .record-form-grid { grid-template-columns: 1fr; gap: 0; }
  .agent-dropzone { align-items: flex-start; min-height: 104px; padding-inline: 0.7rem; }
  .agent-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-result-field-top { grid-template-columns: 3rem minmax(0, 1fr) auto; }
}

@media (prefers-reduced-motion: reduce) {
  .journal-entry,
  .record-success-mark,
  .agent-message { animation: none !important; }
  .agent-progress-track span,
  .agent-inline-progress span { transition: none !important; }
  .map-pin:hover { transform: translate(-50%, -50%) rotate(-45deg); }
}
