/* Shared surfaces and controls for the welfare preview and operations workspace. */
body {
  --growth-canvas: #eeeef1;
  --growth-paper: #f7f7fa;
  --growth-surface: #fff;
  --growth-ink: #211c32;
  --growth-muted: #605a70;
  --growth-line: #dedbe6;
  --growth-field-line: #8d859e;
  --growth-brand: #5436bf;
  --growth-brand-strong: #422993;
  --growth-brand-soft: #eee9fc;
  --growth-poster: #242039;
  --growth-reward: #f0e58a;
  --growth-ok: #285d42;
  --growth-wait: #805019;
  --growth-error: #a52d28;
  --growth-radius: 8px;
  --growth-focus: #7660cf;
  --ink: var(--growth-ink);
  --text: var(--growth-ink);
  --muted: var(--growth-muted);
  --border: var(--growth-line);
  --yellow: var(--growth-brand);
  --pale: var(--growth-brand-soft);
  --bg: var(--growth-paper);
  --panel: var(--growth-surface);
  --soft: var(--growth-paper);
  background: var(--growth-canvas);
  font-family: Geist, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#h5-workspace, .mission-home-banner {
  --welfare-paper: var(--growth-paper);
  --welfare-white: var(--growth-surface);
  --welfare-ink: var(--growth-ink);
  --welfare-muted: var(--growth-muted);
  --welfare-line: var(--growth-line);
  --welfare-green: var(--growth-brand-strong);
  --welfare-tint: var(--growth-brand-soft);
}
button:focus-visible, a:focus-visible, summary:focus-visible,
:is(input, select, textarea):focus-visible {
  outline: 2px solid var(--growth-focus);
  outline-offset: 2px;
}
.global {
  height: 64px;
  background: var(--growth-poster);
  border-color: #3a334f;
}
.brandline { width: 4px; height: 26px; background: var(--growth-reward); border-radius: 2px; }
.branddesc { color: #d7d1e6; }
.head-tag { color: #dbd6e8; background: transparent; border: 0; }
.global-btn { min-height: 38px; border-radius: 6px; color: #f5f2fa; border-color: #746a87; }
.global-btn.active { color: var(--growth-poster); background: var(--growth-reward); border-color: var(--growth-reward); }
.global-btn:hover:not(.active) { background: #3c3452; }

.workspace { gap: 22px; grid-template-columns: 216px minmax(0, 1fr) 250px; }
.rail, .ops-side, .ops-panel, .opscard { border-radius: var(--growth-radius); box-shadow: none; }
.rail { padding: 16px 12px; align-self: start; }
.rail > h3 { padding: 0 8px; margin-bottom: 6px; font-size: 15px; }
.rail-desc, .stage-sub, .phone-footer-info, .navnum { color: var(--growth-muted); }
.stage-top { max-width: 474px; margin-bottom: 10px; }
.stage-title { font-size: 14px; }
.stage-sub { display: none; }
.stage-link { min-height: 36px; border-radius: 6px; border-color: var(--growth-line); }
.navbutton { min-height: 42px; border-radius: 6px; }
.navbutton:hover:not(.active) { background: var(--growth-paper); }
:is(.navbutton.active, #h5-workspace:has(.mission-page) .navbutton.active) {
  color: var(--growth-brand-strong);
  background: var(--growth-brand-soft);
}
#h5-workspace:has(.mission-page) .persona button.active { background: var(--growth-brand); }
.persona { gap: 3px; }
.persona button { min-height: 36px; padding-inline: 0; white-space: nowrap; }
.phone { width: min(100%, 474px) !important; box-shadow: 0 0 0 1px var(--growth-line) !important; }
.phone-head { min-width: 0; flex-basis: 52px; padding: 0 16px; }
.phone-head b { font-size: 15px; }
#phone:has(.mission-page) {
  --welfare-paper: #f6f3ea;
  --welfare-white: #fcfaf3;
  --welfare-ink: #252135;
  --welfare-muted: #5d566b;
  --welfare-line: #cfc6d0;
  --welfare-green: #503481;
  --welfare-tint: #eae2ee;
}
#phone:has(.mission-page) .phone-head {
  flex-basis: 48px;
  background: var(--welfare-paper);
}
#phone:has(.mission-page) #phone-rules {
  min-width: 64px;
  min-height: 40px;
  width: auto;
  padding-inline: 4px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}
.mission-page { padding: 9px 15px 22px; }
#phone:has(.mission-page) .mission-cta:not(:disabled) {
  background: var(--welfare-green);
  border-color: var(--welfare-green);
}
#phone:has(.mission-page) .mission-cta:hover:not(:disabled) {
  background: var(--growth-brand-strong);
}
.mission-cta, .ops-btn.primary-btn, .primary-btn {
  color: #fff;
  background: var(--growth-brand);
  border-color: var(--growth-brand);
  border-radius: 6px;
}
.mission-cta:hover:not(:disabled), .ops-btn.primary-btn:hover:not(:disabled) {
  color: #fff;
  background: var(--growth-brand-strong);
  border-color: var(--growth-brand-strong);
}
.mission-cta:disabled, .mission-page .smbtn:disabled {
  opacity: 1;
  background: var(--growth-paper);
  color: var(--growth-muted);
  border-color: var(--growth-line);
}
.points-strip {
  margin: 0;
  padding: 4px 2px;
  border: 0;
  border-block: 1px solid var(--welfare-line);
  border-radius: 0;
  background: transparent;
}
.points-strip-balance { display: grid; gap: 1px; }
.points-strip-balance strong { color: var(--welfare-ink); }
.points-strip-balance .points-strip-pending { color: var(--growth-wait); }
.mission-section { margin: 12px 0 5px; }
.mission-section h3 { font-size: 19px; font-weight: 800; }
:is(.welfare-topics, .welfare-task-section) .mission-section h3 {
  box-shadow: inset 0 -.3em var(--growth-reward);
}
.welfare-task-list, .welfare-topics ul {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.welfare-task-section .mission-section { margin: 12px 0 4px; }
.welfare-task-section + .welfare-task-section { margin-top: 16px; }
.welfare-task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 6px 0;
  border-bottom: 1px solid var(--welfare-line);
}
.welfare-task-info { display: grid; gap: 3px; min-width: 0; }
.welfare-task-info strong { font-size: 14px; line-height: 1.35; }
.welfare-task-info small { color: var(--welfare-muted); font-size: 12px; line-height: 1.4; }
.welfare-task-info .welfare-task-reward { color: var(--welfare-green); font-weight: 650; }
.mission-page .little-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--welfare-tint);
  color: var(--welfare-green);
}
.mission-page .smbtn, .welfare-utilities .pill {
  min-height: 40px;
  font-size: 12px;
  border-color: var(--welfare-line);
  border-radius: 6px;
}
.mission-page .smbtn:hover:not(:disabled), .welfare-utilities .pill:hover { background: var(--welfare-tint); }
.welfare-task-action,
.welfare-task-status {
  min-width: 64px;
  padding-inline: 2px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.welfare-task-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-height: 44px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--welfare-green);
}
.welfare-task-action span { display: flex; }
.welfare-task-action:hover { background: var(--welfare-tint); }
.welfare-task-status { text-align: right; color: var(--welfare-muted); }
.welfare-topic {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 6px 0;
}
.welfare-topic-art {
  display: grid;
  place-items: center;
  width: 52px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  color: var(--welfare-green);
  background: var(--welfare-tint);
}
.welfare-topic-art img { display: block; object-fit: cover; }
.welfare-topic-text { gap: 2px; }
.welfare-topic-kind { padding: 0; color: var(--welfare-green); background: transparent; }
.welfare-topic-meta { gap: 7px; }
.welfare-topic-excerpt { line-height: 1.38; }
.welfare-topics-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--welfare-muted);
  font-size: 11px;
}
.welfare-more-toggle {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--welfare-green);
  font-weight: 650;
}
.welfare-more-toggle:hover { text-decoration: underline; }
.welfare-topic-links {
  display: flex;
  align-items: center;
  justify-content: center;
  border-block: 1px solid var(--welfare-line);
}
.welfare-topic-links button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding-inline: 14px;
  border: 0;
  background: transparent;
  color: var(--welfare-green);
  font-size: 13px;
  font-weight: 750;
}
.welfare-topic-links button + button { position: relative; }
.welfare-topic-links button + button::before {
  position: absolute;
  inset: 12px auto 12px 0;
  border-left: 1px solid var(--welfare-line);
  content: "";
}
.welfare-topic-links button:hover { background: var(--welfare-tint); }
.welfare-more-topics:not([hidden]) { border-bottom: 1px solid var(--welfare-line); }
.welfare-utilities {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.mission-page .welfare-utilities .pill {
  min-height: 44px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--welfare-green);
  font-weight: 700;
}
.mission-page .welfare-utilities .pill:hover { text-decoration: underline; }
.mission-home-banner {
  min-height: 82px;
  padding: 12px 14px;
  gap: 8px;
  border: 0;
  border-left: 4px solid var(--growth-reward);
  border-radius: 6px;
  color: #fff;
  background: var(--growth-poster);
}
.mission-home-banner small { margin: 0 0 5px; color: var(--growth-reward); }
.mission-home-banner strong { font-size: 18px; }
.mission-banner-cta { display: flex; align-items: center; gap: 3px; color: #eeeaf7; white-space: nowrap; font-size: 12px; }

.phone:has(.mission-sheet) .sheet-backdrop { inset: 0; }
.mission-sheet {
  border-radius: 12px 12px 0 0;
  max-height: 88%;
  padding-top: 0;
  overscroll-behavior: contain;
}
.mission-sheet .sheet-title {
  position: sticky;
  z-index: 2;
  top: 0;
  margin: 0 0 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--welfare-line);
  background: var(--welfare-white);
}
.mission-sheet .sheet-title h3 { font-size: 18px; }
.mission-sheet .sheet-title .iconbutton {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: transparent;
}
.mission-sheet :is(input, textarea) { min-height: 42px; border-color: var(--growth-field-line); border-radius: 6px; }
.mission-sheet .mission-cta, .mission-sheet .mission-scenarios button { min-height: 44px; }
.mission-sheet .mission-scenarios button { border-color: var(--growth-line); border-radius: 6px; }
.point-entry-amount span[data-status="approved"] { color: var(--growth-ok); }
.point-entry-amount span[data-status="pending"] { color: var(--growth-wait); }
.point-entry-amount span[data-status="rejected"] { color: var(--growth-error); }

.ops { grid-template-columns: 208px minmax(0, 1fr); gap: 24px; max-width: 1430px; }
.ops-side { min-height: 0; padding: 14px 10px; }
.ops-nav-title { padding: 4px 10px 12px; font-size: 14px; }
.opshead { margin-bottom: 16px; }
.opshead h1 { font-size: 25px; letter-spacing: -.025em; }
.opshead p, .ops-panel p.desc { color: var(--growth-muted); }
.ops-actions[hidden] { display: none; }
.ops-panel { padding: 19px; margin-bottom: 14px; }
.ops-panel h3 { margin-bottom: 14px; font-size: 16px; }
.ops-btn { min-height: 38px; border-radius: 6px; border-color: var(--growth-line); color: var(--growth-ink); font-size: 13px; }
.ops-btn:hover:not(.primary-btn, :disabled) { background: var(--growth-brand-soft); }
.ops button:disabled { cursor: not-allowed; opacity: .62; }
.ops :is(.points-reward-form, .material-upload, .points-admin-adjust, .points-admin-review, .points-admin-select)
  :is(input, select, textarea) {
  min-height: 40px;
  border: 1px solid var(--growth-field-line);
  border-radius: 6px;
  color: var(--growth-ink);
  background: var(--growth-surface);
}
.material-upload-file input::file-selector-button {
  margin-right: 8px;
  padding: 5px 8px;
  color: var(--growth-brand-strong);
  border: 1px solid var(--growth-line);
  border-radius: 4px;
  background: var(--growth-brand-soft);
  cursor: pointer;
}
.material-upload { align-items: start; }
.material-limit-hint { font-size: 11px; color: var(--growth-muted); }
.material-admin-summary { overflow-wrap: anywhere; }
.material-admin-summary small { color: var(--growth-muted); }
.material-admin-summary small[data-state="open"] { color: var(--growth-ok); }
.points-admin-feedback { color: var(--growth-ok); }
.points-config > summary {
  min-height: 42px;
  padding: 10px 0;
  font-weight: 750;
  cursor: pointer;
}
.points-config .ops-panel { padding: 7px 0 0; margin: 0; border: 0; }
.points-config .ops-panel h3 { display: none; }

@media (max-width: 1200px) {
  .workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .ops { grid-template-columns: 184px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .global { height: 54px; }
  .global-btn { min-height: 36px; font-size: 11px; }
  .workspace { gap: 0; }
  .center { padding: 0; background: var(--growth-canvas); }
  .stage-top { display: none; }
  .phone { width: 100% !important; min-height: min(550px, calc(100dvh - 76px)); height: calc(100dvh - 76px); }
  .phone-footer-info { margin: 5px 10px; font-size: 10px; }
  .left-rail { width: 100%; }
  .ops { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 10px; }
  .ops-side { min-width: 0; }
  .ops-nav-title { display: none; }
  .ops-panel { padding: 14px; }
}
@media (max-width: 380px) {
  .mission-page { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .workspace *, .ops *, .global * { transition-duration: 0s !important; }
}
@media (max-width: 760px) {
  .head-tag { display: inline; padding: 0 4px 0 0; white-space: nowrap; font-size: 10px; }
  .head-right { min-width: 0; }
  .brandname { white-space: nowrap; }
}

#phone-body .hero {
  background: var(--growth-surface);
  color: var(--growth-ink);
  border: 1px solid var(--growth-line);
  border-radius: var(--growth-radius);
  box-shadow: none;
}
#phone-body .hero::after { content: none; }
#phone-body .hero .eyebrow { color: var(--growth-brand-strong); }
#phone-body .hero p { color: var(--growth-muted); }
@media (max-width: 760px) {
  .ops-side #ops-nav {
    display: flex;
    width: 100%;
    gap: 4px;
    overflow-x: auto;
  }
  .ops-side .navbutton {
    flex: 0 0 auto;
    margin: 0;
  }
}

.valuation-game-list button {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--welfare-line);
  background: transparent;
  color: var(--welfare-ink);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}
.valuation-game-list button:hover { background: var(--welfare-tint); }
.valuation-game-list img { border-radius: 6px; }
.mission-valuation-fields select {
  display: block;
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--growth-field-line);
  border-radius: 6px;
  padding: 7px 9px;
  background: var(--welfare-paper);
  color: var(--welfare-ink);
  font: inherit;
}
.mission-valuation-fields label :is(input, select) { margin-top: 5px; }

.welfare-offer-detail-title { color: var(--welfare-green); font-size: 28px; font-weight: 850; }
.welfare-offer-detail-list { margin: 10px 0; padding: 0; list-style: none; }
.welfare-offer-detail-list li { padding: 9px 0; border-bottom: 1px solid var(--welfare-line); }

@media (prefers-reduced-motion: no-preference) {
  :is(.welfare-topic, .valuation-game-list button) {
    transition: transform 130ms ease, background-color 130ms ease;
  }
  :is(.welfare-topic, .valuation-game-list button):active {
    transform: scale(.98);
  }
  .sheet-backdrop.welfare-sheet-entering { animation: welfare-overlay-in 170ms ease both; }
  .sheet-backdrop.welfare-sheet-entering .mission-sheet {
    animation: welfare-sheet-in 220ms cubic-bezier(.2,.7,.2,1) both;
  }
  .sheet-backdrop.welfare-sheet-exiting { animation: welfare-overlay-out 160ms ease both; }
  .sheet-backdrop.welfare-sheet-exiting .mission-sheet { animation: welfare-sheet-out 160ms ease both; }
}
@keyframes welfare-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes welfare-overlay-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes welfare-sheet-in { from { transform: translateY(28px); } to { transform: translateY(0); } }
@keyframes welfare-sheet-out { from { transform: translateY(0); } to { transform: translateY(22px); } }

.welfare-offer-sheet-banner {
  display: flex;
  align-items: center;
  min-height: 80px;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--welfare-white);
  background: #271526 url("./welfare-offer-illustration.webp") right center / auto 100% no-repeat;
}
.welfare-offer-sheet-banner strong { font-size: 28px; }
.welfare-offer-sheet-banner em { color: var(--growth-reward); font-style: normal; }
.welfare-offer-detail-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--welfare-ink);
  text-align: left;
  font-weight: 700;
}
.welfare-offer-detail-list button:hover { color: var(--welfare-green); }
.welfare-offer-detail-list button small { display: flex; align-items: center; gap: 3px; color: var(--welfare-green); }
.welfare-offer-facts { margin: 8px 0; }
.welfare-offer-facts div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--welfare-line); font-size: 13px; }
.welfare-offer-facts dt { color: var(--welfare-muted); }
.welfare-offer-facts dd { margin: 0; font-weight: 700; }
.welfare-sheet-footer {
  position: sticky;
  bottom: -24px;
  margin-top: 10px;
  padding: 8px 0 10px;
  border-top: 1px solid var(--welfare-line);
  background: var(--welfare-white);
}
.welfare-sheet-footer .mission-cta { margin-top: 0; }
.welfare-reply-form { margin-top: 12px; border-top: 1px solid var(--welfare-line); }

.welfare-task-advanced {
  padding-left: 10px;
  border-left: 2px solid var(--welfare-line);
}
.welfare-task-advanced .little-icon {
  background: transparent;
  color: var(--welfare-green);
}

.deal-helper-filters { margin-block: 9px 12px; }
.deal-helper-group { margin-top: 12px; }
.deal-helper-group h4 { font-size: 14px; }
.deal-helper-group ul { list-style: none; margin: 3px 0 0; padding: 0; }
.deal-helper-group li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--welfare-line);
  font-size: 13px;
}
.deal-helper-group li p { margin-top: 2px; color: var(--welfare-muted); line-height: 1.4; }
.deal-helper-group li :is(button, a) { flex-shrink: 0; min-height: 44px; display: inline-flex; align-items: center; margin: 0; }
