/* QGuide V4: field operations, commerce, events, wallet and console layers */

.v4-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--v3-olive);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.v4-network-banner {
  width: min(calc(100% - 40px), var(--v3-content));
  margin: 18px auto 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d1b88d;
  border-radius: 14px;
  background: #fff4d8;
  color: #664b1e;
}
.v4-network-banner > .icon { width: 24px; height: 24px; }
.v4-network-banner > div { display: grid; gap: 2px; flex: 1; }
.v4-network-banner strong { font-family: var(--font-serif); color: #5d4318; }
.v4-network-banner span { font-size: 13px; }
.v4-network-banner button { border: 0; background: transparent; color: var(--v3-accent-dark); font-weight: 700; cursor: pointer; }

.v4-source-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-top: 10px;
  color: var(--v3-muted);
  font-size: 12px;
}
.v4-source-line .icon { width: 16px; height: 16px; color: var(--v3-olive); }
.v4-source-line strong { color: var(--v3-olive); }
.v4-demo-note.v4-source-line { color: var(--v3-muted); }
.v4-demo-note.v4-source-line .icon { color: var(--v3-muted); }
.v4-demo-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.06); color: var(--v3-muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; vertical-align: middle; }
.v4-personal-page header p .v4-demo-tag { display: block; margin: 8px 0 0; width: fit-content; }

.v4-home-hero {
  width: min(calc(100% - 40px), var(--v3-content));
  margin: 28px auto 0;
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  align-items: center;
  gap: 36px;
  padding: clamp(28px, 4vw, 58px);
  border: 1px solid var(--v3-line);
  border-radius: 30px;
  background:
    linear-gradient(100deg, rgba(255,253,248,.98) 0 52%, rgba(255,253,248,.72) 72%, rgba(255,253,248,.2)),
    radial-gradient(circle at 80% 25%, rgba(113,127,78,.18), transparent 35%),
    var(--v3-paper);
  box-shadow: var(--v3-shadow);
  overflow: hidden;
}
.v4-home-hero-copy { position: relative; z-index: 2; }
.v4-home-hero h1 {
  margin: 10px 0 14px;
  color: var(--v3-ink);
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.5vw, 68px);
  line-height: 1.05;
  letter-spacing: .04em;
}
.v4-home-hero p {
  max-width: 680px;
  margin: 0;
  color: #57534b;
  font-size: 18px;
  line-height: 1.8;
}
.v4-home-hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.v4-home-hero-art { position: relative; min-height: 250px; }
.v4-home-hero-art > img:first-child { width: 100%; height: 100%; object-fit: contain; opacity: .9; }
.v4-home-hero-art > img:last-child { position: absolute; right: 4%; bottom: -20px; width: 118px; filter: drop-shadow(0 10px 12px rgba(65,45,22,.12)); }

.v4-home-search-wrap { width: min(calc(100% - 40px), 980px); margin: -28px auto 26px; position: relative; z-index: 3; }
.v4-home-search {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border: 1px solid var(--v3-line-strong);
  border-radius: 24px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 18px 34px rgba(71,52,27,.10);
  color: var(--v3-text);
  cursor: pointer;
}
.v4-home-search > .icon:first-child { width: 28px; height: 28px; color: var(--v3-accent); }
.v4-home-search span:nth-child(2) { display: grid; gap: 3px; text-align: left; }
.v4-home-search strong { color: var(--v3-ink); font-family: var(--font-serif); font-size: 18px; }
.v4-home-search small { color: var(--v3-muted); font-size: 13px; }

.v4-status-grid {
  width: min(calc(100% - 40px), var(--v3-content));
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.v4-status-grid article {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--v3-line);
  border-radius: 18px;
  background: rgba(255,253,248,.88);
  box-shadow: var(--v3-shadow-sm);
}
.v4-status-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--v3-olive-soft);
  color: var(--v3-olive);
}
.v4-status-icon .icon { width: 24px; height: 24px; }
.v4-status-grid article > div { min-width: 0; display: grid; gap: 2px; }
.v4-status-grid small { color: var(--v3-muted); font-size: 11px; }
.v4-status-grid strong { color: var(--v3-ink); font-family: var(--font-serif); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v4-status-grid article > div > span { color: var(--v3-muted); font-size: 12px; }

.v4-alert-card {
  width: min(calc(100% - 40px), var(--v3-content));
  margin: 0 auto 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid #cfd6bc;
  border-radius: 16px;
  background: linear-gradient(90deg, #eef2e5, #fffdf8);
}
.v4-alert-card > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.v4-alert-card > div > .icon { width: 28px; height: 28px; color: var(--v3-olive); }
.v4-alert-card span { display: grid; gap: 2px; }
.v4-alert-card strong { color: var(--v3-ink); font-family: var(--font-serif); }
.v4-alert-card small { color: var(--v3-muted); }

.v4-section {
  width: min(calc(100% - 40px), var(--v3-content));
  margin: 0 auto 42px;
}
.v4-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.v4-section-head > div { display: grid; gap: 4px; }
.v4-section-head span { color: var(--v3-olive); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.v4-section-head h2 { margin: 0; color: var(--v3-ink); font-family: var(--font-serif); font-size: 29px; letter-spacing: .06em; }
.v4-section-head > button,
.v4-section-head a { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--v3-accent-dark); cursor: pointer; font-weight: 700; }

.v4-event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.v4-event-grid-large { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v4-event-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--v3-line);
  border-radius: 20px;
  background: var(--v3-paper);
  box-shadow: var(--v3-shadow-sm);
}
.v4-event-card > button { border: 0; padding: 0; background: transparent; cursor: pointer; }
.v4-event-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.v4-event-card > div { display: grid; gap: 10px; padding: 16px; }
.v4-event-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--v3-muted); font-size: 11px; }
.v4-event-meta span:first-child { color: var(--v3-accent-dark); font-weight: 800; }
.v4-event-card h3 { margin: 0; color: var(--v3-ink); font-family: var(--font-serif); font-size: 21px; }
.v4-event-card p { margin: 0; color: #5c5b55; line-height: 1.65; font-size: 13px; }
.v4-card-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--v3-muted); font-size: 12px; }
.v4-card-row > span { display: inline-flex; align-items: center; gap: 5px; }
.v4-card-row .icon { width: 15px; height: 15px; }
.v4-event-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--v3-olive-soft);
  color: var(--v3-olive);
  font-size: 11px;
  font-weight: 800;
}

.v4-place-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.v4-place-card,
.v4-store-card {
  overflow: hidden;
  border: 1px solid var(--v3-line);
  border-radius: 18px;
  background: var(--v3-paper);
  box-shadow: var(--v3-shadow-sm);
}
.v4-card-image { width: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; }
.v4-card-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.v4-place-card > div,
.v4-store-card > div { padding: 14px; }
.v4-card-title { display: flex; align-items: start; gap: 8px; justify-content: space-between; }
.v4-place-card h3,
.v4-store-card h3 { margin: 0 0 7px; color: var(--v3-ink); font-family: var(--font-serif); font-size: 19px; }
.v4-place-card p,
.v4-store-card p { margin: 0 0 10px; color: var(--v3-muted); font-size: 12px; line-height: 1.55; }
.v4-open-now { display: inline-block; margin-bottom: 8px; color: var(--v3-olive); font-size: 11px; font-weight: 800; }
.v4-coupon-label { color: var(--v3-accent-dark); font-weight: 800; }

.v4-store-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.v4-coupon-teaser {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid #e0a279;
  border-radius: 18px;
  background: linear-gradient(150deg, #fff5ec, #fffdf8 65%);
}
.v4-coupon-teaser > div { display: flex; align-items: flex-start; gap: 12px; }
.v4-coupon-teaser > div > .icon { width: 30px; height: 30px; color: var(--v3-accent); }
.v4-coupon-teaser span { display: grid; gap: 5px; }
.v4-coupon-teaser small { color: var(--v3-accent-dark); font-weight: 800; }
.v4-coupon-teaser strong { color: var(--v3-ink); font-family: var(--font-serif); font-size: 22px; }
.v4-coupon-teaser p { margin: 0; color: var(--v3-muted); font-size: 12px; }

.v4-guide-feature .v3-guide-card { max-width: none; }

.v4-services-grid {
  width: min(calc(100% - 40px), var(--v3-content));
  margin: 0 auto 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
.v4-services-grid > button {
  min-height: 96px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--v3-line);
  border-radius: 18px;
  background: rgba(255,253,248,.88);
  color: var(--v3-text);
  cursor: pointer;
}
.v4-services-grid > button > .icon:first-child { width: 32px; height: 32px; color: var(--v3-olive); }
.v4-services-grid span { display: grid; gap: 4px; text-align: left; }
.v4-services-grid strong { color: var(--v3-ink); font-family: var(--font-serif); font-size: 19px; }
.v4-services-grid small { color: var(--v3-muted); }

.v4-official-panel {
  width: min(calc(100% - 40px), var(--v3-content));
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid var(--v3-line);
  border-radius: 18px;
  background: rgba(255,255,255,.44);
}
.v4-official-panel h2 { margin: 0 0 5px; color: var(--v3-ink); font-family: var(--font-serif); }
.v4-official-panel p { margin: 0; color: var(--v3-muted); }
.v4-official-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.v4-detail-header { grid-template-columns: auto auto minmax(0,1fr) auto; }
.v4-detail-context { min-width: 0; display: grid; justify-self: center; text-align: center; }
.v4-detail-context small { color: var(--v3-muted); font-size: 10px; }
.v4-detail-context strong { color: var(--v3-ink); font-family: var(--font-serif); font-size: 14px; }

.v4-detail-page,
.v4-event-detail,
.v4-list-page,
.v4-search-page,
.v4-personal-page {
  width: min(calc(100% - 40px), var(--v3-content));
  margin: 28px auto 70px;
}
.v4-detail-hero,
.v4-event-detail-hero {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--v3-shadow);
  background: #15200e;
}
.v4-detail-hero > img,
.v4-event-detail-hero > img { width: 100%; height: 430px; object-fit: cover; display: block; filter: brightness(.74); }
.v4-detail-hero-copy,
.v4-event-detail-hero > div {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(26px,5vw,60px);
  color: white;
  background: linear-gradient(transparent, rgba(13,24,28,.86));
}
.v4-detail-hero-copy > span,
.v4-event-detail-hero > div > span { font-size: 13px; font-weight: 800; letter-spacing: .09em; }
.v4-detail-hero h1,
.v4-event-detail-hero h1 { margin: 8px 0; color: white; font-family: var(--font-serif); font-size: clamp(38px,5vw,64px); }
.v4-detail-hero p,
.v4-event-detail-hero p { max-width: 760px; margin: 0; font-size: 17px; line-height: 1.7; }
.v4-detail-badges { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.v4-detail-badges span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; background: rgba(0,0,0,.15); font-size: 12px; }

.v4-detail-layout,
.v4-event-detail-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; margin-top: 22px; align-items: start; }
.v4-detail-section {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--v3-line);
  border-radius: 20px;
  background: var(--v3-paper);
  box-shadow: var(--v3-shadow-sm);
}
.v4-detail-section h2 { margin: 0 0 16px; color: var(--v3-ink); font-family: var(--font-serif); font-size: 24px; }
.v4-detail-section > p { color: #5d5a53; line-height: 1.8; }
.v4-fact-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.v4-fact-grid article { min-height: 92px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e4dacb; border-radius: 14px; background: #fffcf6; }
.v4-fact-grid article > .icon { width: 24px; height: 24px; color: var(--v3-olive); }
.v4-fact-grid span { min-width: 0; display: grid; gap: 3px; }
.v4-fact-grid small { color: var(--v3-muted); font-size: 11px; }
.v4-fact-grid strong { color: var(--v3-ink); font-family: var(--font-serif); }
.v4-facility-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.v4-facility-list span { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--v3-olive-soft); color: #4e5f2b; }
.v4-sticky-action-card { position: sticky; top: 100px; padding: 20px; border: 1px solid var(--v3-line-strong); border-radius: 20px; background: var(--v3-paper); box-shadow: var(--v3-shadow); }
.v4-sticky-action-card h2 { margin: 8px 0 6px; color: var(--v3-ink); font-family: var(--font-serif); }
.v4-sticky-action-card p { color: var(--v3-muted); line-height: 1.6; }
.v4-sticky-action-card .button { margin-top: 8px; }

.v4-list-page > header,
.v4-search-page > header,
.v4-personal-page > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.v4-list-page > header h1,
.v4-search-page > header h1,
.v4-personal-page > header h1 { margin: 6px 0; color: var(--v3-ink); font-family: var(--font-serif); font-size: clamp(34px,4vw,52px); }
.v4-list-page > header p,
.v4-search-page > header p,
.v4-personal-page > header p { margin: 0; color: var(--v3-muted); }
.v4-filter-row { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.v4-filter-row button,
.v4-search-categories button,
.v4-search-scope button { padding: 9px 14px; border: 1px solid var(--v3-line); border-radius: 999px; background: var(--v3-paper); color: var(--v3-text); cursor: pointer; }
.v4-filter-row button.is-active,
.v4-search-categories button.is-active,
.v4-search-scope button.is-active { border-color: var(--v3-accent); background: var(--v3-accent); color: white; }
.v4-info-callout,
.v4-achievement-strip { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-top: 20px; padding: 16px 18px; border: 1px solid var(--v3-line); border-radius: 16px; background: #fffaf0; }
.v4-info-callout > .icon,
.v4-achievement-strip > div > .icon { color: var(--v3-olive); }
.v4-info-callout span,
.v4-achievement-strip > div > span { display: grid; gap: 3px; }
.v4-info-callout small,
.v4-achievement-strip small { color: var(--v3-muted); }

.v4-search-page > header { display: block; }
#v4-search-form { margin-top: 18px; }
#v4-search-form label {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--v3-line-strong);
  border-radius: 18px;
  background: white;
  box-shadow: var(--v3-shadow-sm);
}
#v4-search-form input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--v3-text); font-size: 16px; }
.v4-search-scope { display: flex; gap: 8px; margin-top: 12px; }
.v4-search-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 0; }
.v4-search-categories { display: flex; gap: 7px; flex-wrap: wrap; }
.v4-search-toolbar > div:last-child { display: flex; gap: 8px; }
.v4-search-toolbar select { min-height: 42px; padding: 0 12px; border: 1px solid var(--v3-line); border-radius: 12px; background: white; color: var(--v3-text); }
.v4-search-count { margin: 10px 0 14px; color: var(--v3-muted); }
.v4-search-result-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.v4-search-result { border: 1px solid var(--v3-line); border-radius: 16px; background: var(--v3-paper); overflow: hidden; }
.v4-search-result > button { width: 100%; min-height: 108px; display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 0; background: transparent; color: var(--v3-text); text-align: left; cursor: pointer; }
.v4-search-result img { width: 110px; height: 84px; object-fit: cover; border-radius: 10px; }
.v4-search-result span { min-width: 0; display: grid; gap: 4px; }
.v4-search-result small { color: var(--v3-accent-dark); font-size: 10px; font-weight: 800; }
.v4-search-result strong { color: var(--v3-ink); font-family: var(--font-serif); font-size: 17px; }
.v4-search-result em { color: var(--v3-muted); font-size: 11px; font-style: normal; }
.v4-search-map-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; }
.v4-search-map { position: sticky; top: 92px; height: 620px; border: 1px solid var(--v3-line); border-radius: 20px; overflow: hidden; background: white; }
.v4-search-map img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.v4-map-pin { position: absolute; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--v3-accent); color: white; font-weight: 900; box-shadow: 0 6px 14px rgba(130,50,20,.25); }
.v4-map-pin::first-letter { transform: rotate(45deg); }
.v4-map-pin.p1 { left: 38%; top: 30%; }
.v4-map-pin.p2 { left: 58%; top: 54%; }
.v4-map-pin.p3 { left: 72%; top: 36%; }
.v4-search-result-list { display: grid; gap: 10px; align-content: start; }
.v4-search-result-list .v4-search-result > button { grid-template-columns: 92px 1fr auto; }
.v4-search-result-list .v4-search-result img { width: 92px; height: 72px; }

.v4-wallet-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 26px; }
.v4-wallet-stats article { display: grid; place-items: center; gap: 3px; padding: 20px; border: 1px solid var(--v3-line); border-radius: 18px; background: var(--v3-paper); box-shadow: var(--v3-shadow-sm); }
.v4-wallet-stats strong { color: var(--v3-ink); font-family: Georgia,serif; font-size: 36px; }
.v4-wallet-stats span { color: var(--v3-muted); }
.v4-coupon-card.has-no-image { grid-template-columns: minmax(0, 1fr); }
.v4-coupon-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.v4-coupon-card { display: grid; grid-template-columns: 170px 1fr; gap: 16px; overflow: hidden; border: 1px solid var(--v3-line); border-radius: 18px; background: var(--v3-paper); }
.v4-coupon-card > img { width: 170px; height: 100%; min-height: 190px; object-fit: cover; }
.v4-coupon-card > div { padding: 16px 16px 16px 0; }
.v4-coupon-brand { color: var(--v3-accent-dark); font-size: 11px; font-weight: 800; }
.v4-coupon-card h3 { margin: 5px 0 8px; color: var(--v3-ink); font-family: var(--font-serif); font-size: 21px; }
.v4-coupon-card p { color: var(--v3-muted); line-height: 1.6; font-size: 13px; }
.v4-coupon-card small { color: var(--v3-muted); }
.v4-coupon-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.v4-coupon-card.is-used { opacity: .62; filter: grayscale(.15); }
.v4-inline-link { display: flex; align-items: center; gap: 6px; margin: 0 auto; border: 0; background: transparent; color: var(--v3-accent-dark); font-weight: 800; cursor: pointer; }

.v4-mission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.v4-mission-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 20px; border: 1px solid var(--v3-line); border-radius: 20px; background: var(--v3-paper); box-shadow: var(--v3-shadow-sm); }
.v4-mission-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--v3-olive-soft); color: var(--v3-olive); }
.v4-mission-icon .icon { width: 30px; height: 30px; }
.v4-mission-card > div:nth-child(2) { display: grid; gap: 5px; }
.v4-mission-card > div:nth-child(2) > span { color: var(--v3-accent-dark); font-size: 10px; font-weight: 800; }
.v4-mission-card h2 { margin: 0; color: var(--v3-ink); font-family: var(--font-serif); font-size: 22px; }
.v4-mission-card p { margin: 0; color: var(--v3-muted); }
.v4-progress { height: 8px; overflow: hidden; border-radius: 999px; background: #ece7dc; }
.v4-progress i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,var(--v3-olive),#7f9149); }
.v4-mission-card small { color: var(--v3-muted); }
.v4-mission-card.is-complete { border-color: #bec99d; background: linear-gradient(140deg,#fffdf8,#f1f4e7); }
.v4-badge { color: var(--v3-olive); font-size: 12px; }
.v4-achievement-strip { margin-top: 20px; }
.v4-achievement-strip > div { display: flex; align-items: center; gap: 12px; }

.v4-redeem-modal { text-align: center; }
.v4-redeem-modal h2 { color: var(--v3-ink); font-family: var(--font-serif); }
.v4-fake-qr,
.v4-scan-frame { width: 180px; height: 180px; display: grid; place-items: center; margin: 18px auto; border: 8px solid white; border-radius: 14px; outline: 1px solid var(--v3-line); background: repeating-linear-gradient(45deg,#10202a 0 8px,#fff 8px 16px); color: white; }
.v4-fake-qr .icon,
.v4-scan-frame .icon { width: 72px; height: 72px; background: white; color: var(--v3-ink); border-radius: 12px; padding: 10px; }

.v4-live-page { width: min(calc(100% - 40px), 1320px); margin: 24px auto 50px; }
.v4-live-overview { display: grid; grid-template-columns: 1fr minmax(220px,340px); gap: 20px; align-items: end; margin-bottom: 18px; }
.v4-live-overview small { color: var(--v3-olive); font-weight: 800; }
.v4-live-overview h1 { margin: 5px 0; color: var(--v3-ink); font-family: var(--font-serif); font-size: clamp(34px,4vw,50px); }
.v4-live-overview p { margin: 0; color: var(--v3-muted); }
.v4-live-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--v3-accent); box-shadow: 0 0 0 5px rgba(210,77,22,.11); }
.v4-live-progress { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.v4-live-progress > span { height: 12px; overflow: hidden; border-radius: 999px; background: #e9e3d8; }
.v4-live-progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--v3-accent),#ed7b36); }
.v4-live-progress strong { color: var(--v3-ink); font-family: Georgia,serif; font-size: 26px; }
.v4-live-main { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 18px; align-items: start; }
.v4-live-main > main { display: grid; gap: 14px; }
.v4-live-current { display: grid; grid-template-columns: 1fr 240px; gap: 18px; align-items: stretch; padding: 20px; border: 1px solid var(--v3-line); border-radius: 22px; background: var(--v3-paper); box-shadow: var(--v3-shadow-sm); }
.v4-live-current-copy > span { color: var(--v3-accent-dark); font-size: 11px; font-weight: 800; }
.v4-live-current h2 { margin: 4px 0 8px; color: var(--v3-ink); font-family: var(--font-serif); font-size: 30px; }
.v4-live-current p { color: var(--v3-muted); line-height: 1.65; }
.v4-live-current > img { width: 240px; height: 160px; object-fit: cover; border-radius: 14px; }
.v4-live-map { position: relative; height: 320px; overflow: hidden; border: 1px solid var(--v3-line); border-radius: 22px; background: white; }
.v4-live-map img { width: 100%; height: 100%; object-fit: cover; }
.v4-live-map .button { position: absolute; right: 14px; bottom: 14px; }
.v4-live-primary { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.v4-next-stop { display: grid; grid-template-columns: auto 110px 1fr auto; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--v3-line); border-radius: 18px; background: var(--v3-paper); }
.v4-next-stop > span { color: var(--v3-accent-dark); font-size: 11px; font-weight: 800; }
.v4-next-stop img { width: 110px; height: 82px; object-fit: cover; border-radius: 10px; }
.v4-next-stop h3 { margin: 0; color: var(--v3-ink); font-family: var(--font-serif); }
.v4-next-stop p { margin: 4px 0 0; color: var(--v3-muted); }
.v4-next-stop.is-complete { grid-template-columns: 1fr auto; }
.v4-live-context { padding: 18px; border: 1px solid var(--v3-line); border-radius: 20px; background: rgba(255,253,248,.7); }
.v4-live-context h2 { margin: 0 0 12px; color: var(--v3-ink); font-family: var(--font-serif); }
.v4-live-context > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.v4-live-context button { padding: 12px; border: 1px solid var(--v3-line); border-radius: 12px; background: white; color: var(--v3-text); cursor: pointer; }
.v4-live-advisor,
.v4-live-timeline { padding: 18px; border: 1px solid var(--v3-line); border-radius: 20px; background: var(--v3-paper); box-shadow: var(--v3-shadow-sm); }
.v4-live-advisor > div:first-child { display: flex; gap: 10px; align-items: center; }
.v4-live-advisor > div:first-child > .icon { width: 26px; height: 26px; color: var(--v3-accent); }
.v4-live-advisor > div:first-child span { display: grid; gap: 2px; }
.v4-live-advisor strong,
.v4-live-timeline h2 { color: var(--v3-ink); font-family: var(--font-serif); }
.v4-live-advisor small { color: var(--v3-muted); }
.v4-live-advisor p { color: var(--v3-muted); line-height: 1.7; }
.v4-live-timeline { margin-top: 14px; }
.v4-live-timeline h2 { margin: 0 0 12px; }
.v4-live-timeline > div { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; color: var(--v3-muted); }
.v4-live-timeline > div > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #ece7dd; }
.v4-live-timeline > div.is-done > span { background: var(--v3-olive); color: white; }
.v4-live-timeline > div.is-current > span { background: var(--v3-accent); color: white; }
.v4-live-timeline > div strong { color: var(--v3-ink); }
.v4-live-timeline > div small { font-size: 10px; }
.v4-live-ai-floating { position: fixed; right: max(22px, env(safe-area-inset-right)); bottom: 22px; z-index: 60; display: inline-flex; align-items: center; gap: 7px; padding: 13px 16px; border: 0; border-radius: 999px; background: var(--v3-accent); color: white; box-shadow: 0 10px 30px rgba(177,55,15,.27); cursor: pointer; }

.v4-ai-action-modal > span { display: inline-flex; align-items: center; gap: 6px; color: var(--v3-accent-dark); font-weight: 800; }
.v4-ai-action-modal h2 { color: var(--v3-ink); font-family: var(--font-serif); }
.v4-ai-action-modal > p { color: var(--v3-muted); line-height: 1.75; }
.v4-ai-plan { display: grid; gap: 8px; margin: 16px 0; padding: 14px; border-radius: 14px; background: var(--v3-olive-soft); }
.v4-ai-plan strong { color: var(--v3-olive); }
.v4-ai-plan span::before { content: "✓"; margin-right: 7px; color: var(--v3-olive); font-weight: 900; }

/* Console and merchant */
body.v4-console-mode { background: #f5f2eb; }
body.v4-console-mode .site-footer { display: none !important; }
.v4-console-header { width: min(calc(100% - 38px), 1560px); min-height: 76px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.v4-console-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--v3-ink); }
.v4-console-scope { color: var(--v3-muted); font-size: 13px; }
.v4-console-header > div:last-child { display: flex; gap: 8px; }
.v4-console-shell { width: min(calc(100% - 24px), 1600px); margin: 18px auto 40px; display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 16px; }
.v4-console-sidebar { position: sticky; top: 94px; align-self: start; min-height: calc(100vh - 130px); padding: 18px; border: 1px solid var(--v3-line); border-radius: 20px; background: #fffdf8; box-shadow: var(--v3-shadow-sm); }
.v4-console-destination { display: grid; gap: 4px; padding-bottom: 16px; border-bottom: 1px solid var(--v3-line); }
.v4-console-destination small { color: var(--v3-muted); }
.v4-console-destination strong { color: var(--v3-ink); font-family: var(--font-serif); font-size: 19px; }
.v4-console-destination span { color: var(--v3-muted); font-size: 11px; }
.v4-merchant-switcher { display: grid; gap: 4px; margin-top: 12px; }
.v4-merchant-switcher span { color: var(--v3-muted); font-size: 11px; }
.v4-merchant-switcher select { min-height: 38px; padding: 0 10px; border: 1px solid var(--v3-line); border-radius: 10px; background: white; color: var(--v3-text); font-size: 13px; }
.v4-console-sidebar nav { display: grid; gap: 6px; margin-top: 14px; }
.v4-console-sidebar nav a { padding: 11px 12px; border-radius: 10px; color: var(--v3-text); }
.v4-console-sidebar nav a:hover,
.v4-console-sidebar nav a.is-active { background: var(--v3-olive-soft); color: var(--v3-olive); font-weight: 800; }
.v4-console-note { margin-top: 24px; padding: 12px; border-radius: 10px; background: #f5efe5; color: var(--v3-muted); font-size: 11px; line-height: 1.5; }
.v4-console-main { min-width: 0; }
.v4-console-page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 4px 4px 0; }
.v4-console-page-head span { color: var(--v3-accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.v4-console-page-head h1 { margin: 4px 0; color: var(--v3-ink); font-family: var(--font-serif); font-size: 36px; }
.v4-console-page-head p { margin: 0; color: var(--v3-muted); }
.v4-console-metrics { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
/* 店家後台有七格（曝光/查看/導航/加入路線/收藏/分享/核銷），固定五欄會排成
   彆扭的 5+2。只有這一處換成自動換行，其他共用這個 class 的地方版面不變。 */
.v4-console-metrics.is-merchant { grid-template-columns: repeat(auto-fit,minmax(132px,1fr)); }
.v4-console-metrics article { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--v3-line); border-radius: 16px; background: white; }
.v4-console-metrics span { color: var(--v3-muted); font-size: 11px; }
.v4-console-metrics strong { color: var(--v3-ink); font-family: Georgia,serif; font-size: 28px; }
.v4-console-metrics em { color: var(--v3-olive); font-size: 11px; font-style: normal; }
.v4-console-two { display: grid; grid-template-columns: 1.3fr .7fr; gap: 12px; margin-bottom: 12px; }
.v4-console-panel { margin-bottom: 12px; padding: 18px; border: 1px solid var(--v3-line); border-radius: 18px; background: white; box-shadow: 0 4px 14px rgba(60,45,25,.035); }
.v4-console-panel h2 { margin: 0 0 14px; color: var(--v3-ink); font-family: var(--font-serif); font-size: 20px; }
.v4-console-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.v4-console-panel-head h2 { margin: 0; }
.v4-console-panel-head span,
.v4-console-panel-head a { color: var(--v3-muted); font-size: 12px; }
.v4-issue-list { display: grid; gap: 8px; }
.v4-issue-list article { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: #fbf8f1; }
.v4-issue-list article > span { width: 8px; height: 8px; border-radius: 50%; background: #708242; }
.v4-issue-list article > span.warning { background: #d59a2d; }
.v4-issue-list article > span.info { background: #4f7d9c; }
.v4-issue-list div { display: grid; gap: 2px; }
.v4-issue-list strong { color: var(--v3-ink); font-size: 13px; }
.v4-issue-list small { color: var(--v3-muted); }
.v4-issue-list button { border: 0; background: transparent; color: var(--v3-accent-dark); cursor: pointer; font-weight: 700; }
.v4-ranked-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.v4-ranked-list li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eee8de; }
.v4-ranked-list li:last-child { border-bottom: 0; }
.v4-ranked-list li > span { color: var(--v3-accent-dark); font-family: Georgia,serif; font-size: 18px; }
.v4-ranked-list strong { color: var(--v3-text); font-size: 13px; }
.v4-ranked-list em { color: var(--v3-muted); font-style: normal; font-size: 12px; }
.v4-funnel { display: grid; gap: 8px; }
.v4-funnel > div { width: var(--w); min-width: 240px; display: flex; justify-content: space-between; gap: 20px; padding: 10px 12px; border-radius: 8px; background: linear-gradient(90deg,#d95b1f,#f1a25c); color: white; }
.v4-funnel > div:nth-child(even) { background: linear-gradient(90deg,#566b31,#81934d); }
.v4-console-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.v4-console-tabs button { padding: 8px 12px; border: 1px solid var(--v3-line); border-radius: 9px; background: white; color: var(--v3-text); }
.v4-console-tabs button.is-active { background: var(--v3-ink); color: white; }
.v4-console-table-head,
.v4-console-table-row { display: grid; grid-template-columns: minmax(260px,2fr) .7fr .7fr .8fr 70px; gap: 12px; align-items: center; }
.v4-console-table-head { padding: 0 10px 10px; color: var(--v3-muted); font-size: 11px; }
.v4-console-table-row { padding: 10px; border-top: 1px solid #eee8de; }
.v4-console-table-row > div:first-child { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: center; }
.v4-console-table-row img { width: 58px; height: 48px; border-radius: 8px; object-fit: cover; }
.v4-console-table-row > div:first-child span { display: grid; gap: 2px; }
.v4-console-table-row strong { color: var(--v3-ink); }
.v4-console-table-row small { color: var(--v3-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v4-console-table-row > button { border: 0; background: transparent; color: var(--v3-accent-dark); cursor: pointer; }
.v4-bar-chart { display: grid; gap: 11px; }
.v4-bar-chart > div { display: grid; grid-template-columns: 160px 1fr 50px; gap: 10px; align-items: center; }
.v4-bar-chart span { color: var(--v3-text); font-size: 12px; }
.v4-bar-chart i { height: 10px; overflow: hidden; border-radius: 999px; background: #ece7dc; }
.v4-bar-chart b { height: 100%; display: block; background: linear-gradient(90deg,var(--v3-olive),#8aa05b); }
.v4-bar-chart strong { color: var(--v3-muted); font-size: 11px; }
.v4-publish-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 14px; }
.v4-publish-content { display: grid; grid-template-columns: 100px 1fr auto; gap: 12px; align-items: center; }
.v4-publish-content > img { width: 100px; height: 100px; object-fit: cover; border-radius: 10px; }
.v4-publish-content h3 { margin: 5px 0; color: var(--v3-ink); font-family: var(--font-serif); }
.v4-publish-content p { margin: 0; color: var(--v3-muted); }
.v4-channel-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.v4-channel-grid label { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: center; padding: 14px; border: 1px solid var(--v3-line); border-radius: 12px; cursor: pointer; }
.v4-channel-grid label.is-on { border-color: #9dad76; background: #f1f5e7; }
.v4-channel-grid input { position: absolute; opacity: 0; }
.v4-channel-grid label > span { grid-row: 1 / span 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--v3-olive-soft); color: var(--v3-olive); }
.v4-channel-grid strong { color: var(--v3-ink); }
.v4-channel-grid small { color: var(--v3-muted); }
.v4-publish-schedule { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.v4-publish-schedule label { display: grid; gap: 6px; color: var(--v3-muted); font-size: 12px; }
.v4-publish-schedule input { min-height: 42px; padding: 0 10px; border: 1px solid var(--v3-line); border-radius: 10px; background: white; }
.v4-publish-submit { min-height: 54px; }
.v4-publish-preview { position: sticky; top: 94px; align-self: start; display: grid; gap: 10px; padding: 16px; border: 1px solid var(--v3-line); border-radius: 18px; background: white; }
.v4-publish-preview > span { color: var(--v3-muted); font-size: 11px; }
.v4-publish-preview img { width: 100%; max-height: 560px; object-fit: contain; border-radius: 12px; background: #f6f2ea; }
.v4-publish-preview > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.v4-publish-preview button { padding: 7px; border: 1px solid var(--v3-line); border-radius: 8px; background: white; color: var(--v3-text); }
.v4-publish-preview button.is-active { background: var(--v3-ink); color: white; }
.v4-publish-success { text-align: center; }
.v4-publish-success > .icon { width: 56px; height: 56px; padding: 12px; border-radius: 50%; background: var(--v3-olive); color: white; }
.v4-redemption-list { display: grid; gap: 8px; }
.v4-redemption-list article { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: #fbf8f1; }
.v4-redemption-list small { color: var(--v3-muted); }

.v4-empty-card { padding: 24px; border: 1px dashed var(--v3-line-strong); border-radius: 16px; color: var(--v3-muted); text-align: center; background: rgba(255,255,255,.35); }
.v4-not-found { min-height: 55vh; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; }
.v4-not-found > .icon { width: 50px; height: 50px; color: var(--v3-accent); }
.v4-not-found h1 { margin: 0; color: var(--v3-ink); font-family: var(--font-serif); }
.v4-facility-modal { display: grid; gap: 12px; }

@media (max-width: 1180px) {
  .v4-home-hero { grid-template-columns: 1fr 380px; }
  .v4-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .v4-place-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .v4-store-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .v4-event-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .v4-search-result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .v4-fact-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .v4-console-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .v4-console-shell { grid-template-columns: 220px minmax(0,1fr); }
}

@media (max-width: 940px) {
  .v4-home-hero { grid-template-columns: 1fr; min-height: 0; }
  .v4-home-hero-art { min-height: 180px; }
  .v4-home-hero-art > img:last-child { width: 90px; right: 10px; }
  .v4-home-search-wrap { margin-top: -20px; }
  .v4-services-grid { grid-template-columns: 1fr; }
  .v4-official-panel { grid-template-columns: 1fr; }
  .v4-detail-layout,
  .v4-event-detail-grid,
  .v4-live-main,
  .v4-search-map-layout,
  .v4-publish-layout { grid-template-columns: 1fr; }
  .v4-sticky-action-card,
  .v4-publish-preview,
  .v4-search-map { position: relative; top: auto; }
  .v4-search-map { height: 420px; }
  .v4-coupon-grid { grid-template-columns: 1fr; }
  .v4-mission-grid { grid-template-columns: 1fr; }
  .v4-console-shell { grid-template-columns: 1fr; }
  .v4-console-sidebar { position: relative; top: auto; min-height: 0; }
  .v4-console-sidebar nav { grid-template-columns: repeat(5,minmax(0,1fr)); overflow-x: auto; }
  .v4-console-two { grid-template-columns: 1fr; }
  .v4-console-table-head { display: none; }
  .v4-console-table-row { grid-template-columns: 1fr auto; }
  .v4-console-table-row > span { display: none; }
}

@media (max-width: 680px) {
  .v4-network-banner,
  .v4-home-hero,
  .v4-status-grid,
  .v4-alert-card,
  .v4-section,
  .v4-services-grid,
  .v4-official-panel,
  .v4-detail-page,
  .v4-event-detail,
  .v4-list-page,
  .v4-search-page,
  .v4-personal-page,
  .v4-live-page { width: min(calc(100% - 22px), var(--v3-content)); }

  .v4-network-banner { align-items: flex-start; }
  .v4-network-banner button { display: none; }
  .v4-home-hero { margin-top: 12px; padding: 22px 18px 28px; border-radius: 22px; }
  .v4-home-hero h1 { font-size: 36px; }
  .v4-home-hero p { font-size: 15px; }
  .v4-home-hero-art { display: none; }
  .v4-home-hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .v4-home-hero-actions .button { width: 100%; justify-content: center; }
  .v4-home-search-wrap { width: calc(100% - 30px); margin: -10px auto 18px; }
  .v4-home-search { min-height: 68px; border-radius: 18px; }
  .v4-home-search strong { font-size: 15px; }
  .v4-home-search small { font-size: 11px; }
  .v4-status-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .v4-status-grid article { padding: 12px; gap: 9px; min-width: 0; }
  .v4-status-icon { width: 38px; height: 38px; }
  .v4-status-grid strong { font-size: 14px; }
  .v4-status-grid article > div > span { display: none; }
  .v4-alert-card { align-items: flex-start; }
  .v4-alert-card > button { display: none; }
  .v4-section { margin-bottom: 30px; }
  .v4-section-head h2 { font-size: 24px; }
  .v4-event-grid,
  .v4-place-grid,
  .v4-store-grid,
  .v4-search-result-grid { grid-template-columns: 1fr; }
  .v4-event-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 5px; }
  .v4-event-card { min-width: 82vw; scroll-snap-align: start; }
  .v4-place-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .v4-place-card p { display: none; }
  .v4-card-row { gap: 6px; }
  .v4-card-row span:nth-child(n+3) { display: none; }
  .v4-store-grid { grid-template-columns: 1fr; }
  .v4-services-grid > button { min-height: 82px; }
  .v4-official-actions { display: grid; grid-template-columns: repeat(3,1fr); }
  .v4-official-actions .button { padding-inline: 8px; font-size: 12px; }

  .v4-detail-header { grid-template-columns: auto 1fr auto; }
  .v4-detail-context { display: none; }
  .v4-detail-hero,
  .v4-event-detail-hero { min-height: 360px; border-radius: 20px; }
  .v4-detail-hero > img,
  .v4-event-detail-hero > img { height: 360px; }
  .v4-detail-hero-copy,
  .v4-event-detail-hero > div { padding: 22px 18px; }
  .v4-detail-hero h1,
  .v4-event-detail-hero h1 { font-size: 34px; }
  .v4-detail-hero p,
  .v4-event-detail-hero p { font-size: 14px; }
  .v4-fact-grid { grid-template-columns: 1fr 1fr; }
  .v4-fact-grid article { min-height: 78px; padding: 10px; }
  .v4-fact-grid article > .icon { display: none; }
  .v4-facility-list { grid-template-columns: 1fr; }
  .v4-sticky-action-card { position: static; }

  .v4-list-page > header,
  .v4-personal-page > header { display: block; }
  .v4-list-page > header .button { margin-top: 14px; }
  .v4-filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .v4-filter-row button { white-space: nowrap; }
  #v4-search-form label { grid-template-columns: auto 1fr; padding: 8px 12px; }
  #v4-search-form button { grid-column: 1 / -1; width: 100%; }
  .v4-search-toolbar { display: grid; }
  .v4-search-toolbar > div:last-child { justify-content: space-between; }
  .v4-search-categories { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .v4-search-categories button { white-space: nowrap; }
  .v4-search-result > button { grid-template-columns: 92px 1fr auto; }
  .v4-search-result img { width: 92px; height: 72px; }
  .v4-search-map { height: 340px; }

  .v4-wallet-stats { grid-template-columns: repeat(2,1fr); gap: 7px; }
  .v4-wallet-stats article { padding: 12px 4px; }
  .v4-wallet-stats strong { font-size: 28px; }
  .v4-coupon-card { grid-template-columns: 110px 1fr; }
  .v4-coupon-card > img { width: 110px; min-height: 170px; }
  .v4-coupon-card > div { padding: 12px 12px 12px 0; }
  .v4-coupon-card h3 { font-size: 17px; }
  .v4-coupon-card p { font-size: 11px; }
  .v4-coupon-actions { display: grid; }
  .v4-mission-card { grid-template-columns: auto 1fr; }
  .v4-mission-card > button,
  .v4-badge { grid-column: 1 / -1; }
  .v4-mission-icon { width: 52px; height: 52px; }
  .v4-achievement-strip { display: grid; }

  .v4-live-overview { grid-template-columns: 1fr; }
  .v4-live-overview h1 { font-size: 31px; }
  .v4-live-current { grid-template-columns: 1fr; }
  .v4-live-current > img { width: 100%; height: 190px; }
  .v4-live-map { height: 250px; }
  .v4-live-primary { grid-template-columns: 1fr 1fr; }
  .v4-next-stop { grid-template-columns: 1fr 90px; }
  .v4-next-stop > span { grid-column: 1 / -1; }
  .v4-next-stop > div { grid-column: 1; }
  .v4-next-stop img { grid-column: 2; grid-row: 2; width: 90px; height: 68px; }
  .v4-next-stop > button { grid-column: 1 / -1; }
  .v4-live-context > div { grid-template-columns: 1fr 1fr; }
  .v4-live-ai-floating { right: 12px; bottom: 14px; }

  .v4-console-header { width: calc(100% - 20px); min-height: 68px; grid-template-columns: 1fr auto; }
  .v4-console-scope { display: none; }
  .v4-console-header .button:first-child { display: none; }
  .v4-console-shell { width: calc(100% - 14px); margin-top: 8px; }
  .v4-console-sidebar { padding: 10px; }
  .v4-console-destination { display: none; }
  .v4-merchant-switcher { display: none; }
  .v4-console-sidebar nav { margin-top: 0; grid-template-columns: repeat(5, max-content); overflow-x: auto; }
  .v4-console-sidebar nav a { padding: 9px 10px; }
  .v4-console-note { display: none; }
  .v4-console-page-head { display: block; padding: 0 4px; }
  .v4-console-page-head h1 { font-size: 30px; }
  .v4-console-page-head .button { margin-top: 10px; }
  .v4-console-metrics { grid-template-columns: 1fr 1fr; }
  .v4-console-metrics article { padding: 12px; }
  .v4-console-metrics strong { font-size: 24px; }
  .v4-funnel > div { min-width: 170px; }
  .v4-console-table-row { grid-template-columns: 1fr auto; }
  .v4-console-table-row > div:first-child { grid-template-columns: 52px 1fr; }
  .v4-channel-grid { grid-template-columns: 1fr; }
  .v4-publish-schedule { grid-template-columns: 1fr; }
  .v4-redemption-list article { grid-template-columns: auto 1fr; }
  .v4-redemption-list small { grid-column: 1 / -1; }
}

/* V4 QA repair: keep console grid children from expanding mobile viewport */
.v4-console-sidebar,
.v4-console-main { min-width: 0; }
@media (max-width: 680px) {
  .v4-console-sidebar nav { width: 100%; max-width: 100%; min-width: 0; }
  .v4-console-sidebar nav a { min-width: max-content; }
  .v4-console-metrics,
  .v4-console-two,
  .v4-console-panel,
  .v4-console-page-head { min-width: 0; max-width: 100%; }
}

/* 攻略製作空狀態的第二條路：做路線攻略圖不需要登入，所以那條出路必須看得出來
   是可以按的，不能混在說明文字裡（原本只有「請登入」一顆按鈕，使用者以為那是
   唯一的路）。刻意做成次要樣式，不跟主要按鈕搶。 */
.ql-my-poster-alt {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 8px 14px;
  border: 1px solid var(--v3-line, #d9e2ec); border-radius: 999px;
  color: #12263F; font-size: 14px; text-decoration: none; background: #fff;
}
.ql-my-poster-alt:hover { border-color: #12263F; }
.ql-my-poster-alt svg { width: 16px; height: 16px; }

/* 票夾：目前場域沒有優惠時的說明。要看得出是狀態說明不是廣告文案。 */
.v4-wallet-venue-note {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 12px; padding: 10px 14px;
  background: #F1F6FA; border-radius: 10px; color: #45677A; font-size: 13px;
}
.v4-wallet-venue-note svg { width: 16px; height: 16px; flex: none; }

/* 店家後台的期間對比。上下箭頭用顏色也用符號——只靠顏色的話，色覺障礙的店家
   看到的是兩個一樣的數字。 */
.v4-range-picker { display: flex; gap: 6px; }
.v4-range-picker button { border: 1px solid var(--v3-line); border-radius: 999px; background: white; color: var(--v3-muted); padding: 5px 12px; font-size: 12px; cursor: pointer; }
.v4-range-picker button.is-active { background: var(--v3-olive); border-color: var(--v3-olive); color: white; }
.v4-range-window { margin: 0 0 12px; color: var(--v3-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.v4-range-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(132px,1fr)); gap: 10px; }
.v4-range-grid article { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--v3-line); border-radius: 14px; background: white; }
.v4-range-grid span { color: var(--v3-muted); font-size: 11px; }
.v4-range-grid strong { color: var(--v3-ink); font-family: Georgia,serif; font-size: 26px; font-variant-numeric: tabular-nums; }
.v4-range-grid em { font-style: normal; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.v4-range-grid em.is-up { color: #2f7a44; }
.v4-range-grid em.is-down { color: #a5463a; }
.v4-range-grid em.is-flat { color: var(--v3-muted); }
.v4-range-grid small { color: var(--v3-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.v4-range-spark { margin-top: 14px; }
.v4-range-spark-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; padding: 0 2px; border-bottom: 1px solid var(--v3-line); }
.v4-range-spark-bars i { flex: 1 1 0; min-width: 2px; border-radius: 2px 2px 0 0; background: var(--v3-olive); opacity: .75; }
.v4-range-spark-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--v3-muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* 任務卡右側原本是一顆「模擬完成一步」，按了就加一。改成說明「什麼事會讓它動」，
   或者誠實標示到訪打卡還沒開放——右欄要留得住兩三行字，所以給固定寬度。 */
.v4-mission-note { display: flex; align-items: center; gap: 6px; max-width: 168px; color: var(--v3-muted); font-size: 12px; line-height: 1.5; text-align: left; }
.v4-mission-note.is-locked { color: var(--v3-muted); opacity: .8; }
.v4-mission-note svg { flex: 0 0 auto; width: 15px; height: 15px; }

/* 任務卡本來只說「什麼事會讓它動」，卻沒有一條路過去——2026-09-09 實測
   #/missions 整頁 19 張卡、1078 個字，只有一個可點元素。這是那條路。
   🔴 卡片是三欄 grid 且原本剛好三個子項，這是第四個，一定要明講欄位，
   否則會掉到第二列第一欄（圖示底下）。 */
.v4-mission-go { grid-column: 3; justify-self: start; display: inline-flex; align-items: center; gap: 4px; max-width: 168px; color: var(--v3-accent-dark); font-size: 12px; font-weight: 700; text-decoration: none; }
.v4-mission-go:hover { text-decoration: underline; }
.v4-mission-go svg { flex: 0 0 auto; width: 14px; height: 14px; }
.v4-mission-card.is-complete .v4-mission-go { display: none; }

@media (max-width: 720px) {
  .v4-mission-card { grid-template-columns: auto 1fr; }
  .v4-mission-note, .v4-mission-card .v4-badge { grid-column: 2; max-width: none; }
  /* 兩欄版：說明與連結都退到第二欄，連結自己一列，維持 44px 的點擊高度。 */
  .v4-mission-go { grid-column: 2; max-width: none; min-height: 44px; }
}

/* 到訪類任務還沒有打卡機制。整張卡調淡，讓它跟真的能推進的任務一眼分得開——
   只靠右邊那行小字的話，掃過去看起來跟其他卡一樣「正在進行」。 */
.v4-mission-card.is-locked { background: transparent; box-shadow: none; }
.v4-mission-card.is-locked .v4-mission-icon,
.v4-mission-card.is-locked h2 { opacity: .72; }
.v4-mission-card.is-locked .v4-progress i { background: var(--v3-line); }

/* ---------- 合作方案對照（松菸 2026-09-02 第 4 點）---------- */
/* 表格在窄螢幕會超出——店家多半用手機看，所以捲動框在表格自己身上，
   不讓整個頁面橫向捲動。 */
.v4-plan-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.v4-plan-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.v4-plan-table thead th { padding: 8px 12px; border-bottom: 1px solid var(--v3-line); color: var(--v3-muted); font-size: 12px; font-weight: 600; text-align: left; }
.v4-plan-table thead th:last-child { color: #0f766e; }
.v4-plan-table tbody th { width: 26%; padding: 14px 12px; border-bottom: 1px solid var(--v3-line); color: var(--v3-ink); font-weight: 600; text-align: left; vertical-align: top; }
.v4-plan-table td { padding: 14px 12px; border-bottom: 1px solid var(--v3-line); vertical-align: top; line-height: 1.6; }
.v4-plan-none { width: 30%; color: var(--v3-muted); }
.v4-plan-partner { display: table-cell; color: var(--v3-ink); }
.v4-plan-partner svg { width: 15px; height: 15px; margin-right: 6px; color: #0f766e; vertical-align: -2px; }
.v4-plan-partner span { display: inline; }

.v4-plan-later h2, .v4-plan-start h2 { display: flex; align-items: center; gap: 8px; }
.v4-plan-later h2 svg { width: 18px; height: 18px; color: var(--v3-muted); }
.v4-plan-later p, .v4-plan-start p { margin: 0 0 12px; color: var(--v3-muted); font-size: 14px; line-height: 1.7; }
.v4-plan-later ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--v3-ink); font-size: 14px; line-height: 1.6; }
.v4-plan-start { background: #f7fbfa; border-color: #cfe6e1; }

/* 🔴 窄螢幕改成堆疊。店家幾乎都用手機看，而橫向捲動會把「合作之後」那一欄
   ——這一頁真正要講的東西——藏在畫面外。實測 375px 只看得到一個勾。 */
@media (max-width: 700px) {
  .v4-plan-table { min-width: 0; }
  .v4-plan-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .v4-plan-table tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--v3-line); }
  .v4-plan-table tr:last-child { border-bottom: 0; }
  .v4-plan-table tbody th { display: block; width: auto; padding: 0 0 10px; border-bottom: 0; font-size: 15px; }
  .v4-plan-table td { display: block; width: auto; padding: 0 0 0 12px; border-bottom: 0; }
  .v4-plan-table td + td { margin-top: 10px; }
  .v4-plan-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--v3-muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
  .v4-plan-none { border-left: 2px solid var(--v3-line); }
  .v4-plan-partner { border-left: 2px solid #0f766e; }
  .v4-plan-partner::before { color: #0f766e; }
}

/* 店家後台的券清單。店家在這裡要看的是「我有哪幾張券、各被核銷幾次」，
   不是旅客的領取／出示按鈕。 */
.v4-merchant-coupons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.v4-merchant-coupons li { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--v3-line); border-radius: 12px; background: #fbf8f1; }
.v4-merchant-coupons strong { color: var(--v3-ink); font-size: 15px; }
.v4-merchant-coupons span { color: #0f766e; font-size: 13px; font-weight: 600; }
.v4-merchant-coupons small { color: var(--v3-muted); font-size: 12.5px; }
.v4-merchant-coupons em { justify-self: start; font-style: normal; }

/* 店家端登入前的「登入之後有什麼」。
 *
 * 2026-09-09 之前這一區只有「請先登入」一句話——店家被推薦後點進來，
 * 在登入前看不到任何理由。三項都是實際拿得到的東西；流量那一項目前
 * 仍是模擬值，所以沿用既有的 .v4-demo-tag 標出來，不另立一套標記。 */
.v4-merchant-benefits {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v4-merchant-benefits li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #4c5b5e;
}

.v4-merchant-benefits .icon {
  width: 19px;
  height: 19px;
  margin-top: 4px;
  color: var(--ql-action, #174e5b);
}

.v4-merchant-benefits strong { color: #1f3134; }
/* A5：後台顯示示範數字的分頁頁首說明；旅程進行中頁沒有真的旅程時的空白狀態。 */
.v4-demo-banner{display:block;margin:0 0 14px}
.v4-live-empty{max-width:560px;margin:48px auto;padding:28px 20px;text-align:center}
.v4-live-empty p{line-height:1.7}
.v4-live-empty div{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:18px}
