:root {
  --red-main: #A72D24;
  --red-deep: #7F211A;
  --red-action: #C44232;
  --red-soft: #FFF2EA;
  --red-paper: #FBE3DA;
  --red-line: #E5B8AC;
  --red-ink: #5C1E18;
  --wood: #2F8F63;
  --wood-deep: #1F5B3E;
  --wood-soft: #EAF4EE;
  --water: #2F7F96;
  --water-deep: #1F5F73;
  --water-soft: #DCEFF3;
  --water-line: #B8D7DE;
  --earth: #F7EBD8;
  --card: #FFF9F0;
  --gold: #C49A45;
  --ink: #2F261F;
  --muted: #8A7866;
  --line: #E8D8C3;
  --shadow: 0 18px 44px rgba(93, 50, 22, .12);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--earth);
  color: var(--ink);
  font-family: var(--font);
}

button,
input,
textarea {
  font: inherit;
}

button { cursor: pointer; }

.super-app {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0;
  font-size: 16px;
  line-height: normal;
}

.phone {
  width: min(430px, 100%);
  max-width: 430px;
  aspect-ratio: 846 / 1732;
  margin: 0 auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(92, 30, 24, .92);
  border-radius: 44px;
  background: var(--red-ink);
  box-shadow: var(--shadow);
}

.screen {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 78px;
  border-radius: 36px;
  background: var(--red-soft);
  -webkit-overflow-scrolling: touch;
}

.screen.no-nav {
  padding-bottom: 18px;
}

.screen.sub {
  overflow-y: auto;
  padding-bottom: 74px;
}

.screen.action-fixed {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

.screen.action-fixed > .action-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen-scroll {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 78px;
  -webkit-overflow-scrolling: touch;
}

.screen.no-nav .screen-scroll {
  padding-bottom: 92px;
}

.status {
  height: 27px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--red-soft);
  font-size: 10px;
  font-weight: 900;
}

.top {
  padding: 14px 15px;
  color: #fff;
  background: var(--red-main);
}

.top-row,
.subtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-row.with-back {
  justify-content: flex-start;
}

.top-title {
  min-width: 0;
  flex: 1 1 auto;
}

.top .top-back {
  flex: 0 0 32px;
  color: rgba(255, 249, 240, .96);
  border-color: rgba(255, 249, 240, .72);
  background: rgba(255, 249, 240, .12);
}

.top-row.with-back .pill {
  margin-left: auto;
}

.top h1,
.top h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: -.35px;
}

.top small,
.subtop small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 249, 240, .82);
  font-size: 10.5px;
  font-weight: 800;
}

.subtop {
  min-height: 54px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--red-line);
  background: rgba(255, 249, 240, .76);
}

.subtop b {
  display: block;
  font-size: 15.5px;
  line-height: 1.2;
  letter-spacing: -.12px;
}

.subtop small {
  color: var(--muted);
}

.circle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: currentColor;
  background: transparent;
  font-size: 16px;
  font-weight: 900;
}

.pill {
  min-height: 21px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: var(--red-main);
  background: #FFEAE2;
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.action,
.pill.danger,
.pill.red {
  color: #fff;
  background: var(--red-action);
}

.pill.wood,
.pill.green {
  color: var(--wood-deep);
  background: var(--wood-soft);
}

.pill.water {
  color: var(--water-deep);
  background: var(--water-soft);
}

.pill.gold {
  color: #775114;
  background: #FFF3D3;
}

.pill.gray {
  color: #6E6255;
  background: #EFE8DD;
}

.pill.is-action {
  cursor: pointer;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 0 12px 10px;
  overflow: hidden;
}

.tabs span,
.tab {
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  color: #7E3A31;
  background: #F6DED5;
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
}

.tabs .on,
.tab.active {
  color: #fff;
  background: var(--red-action);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 12px;
}

.metric,
.card,
.list,
.form-card {
  border: 1px solid var(--red-line);
  background: var(--card);
}

.metric {
  min-height: 74px;
  padding: 11px;
  border-radius: 17px;
}

.metric b {
  display: block;
  margin-bottom: 4px;
  color: var(--red-main);
  font-size: 16.5px;
  line-height: 1.15;
}

.metric span {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.card,
.form-card {
  margin: 11px 12px;
  padding: 12px;
  border-radius: 18px;
}

.card.soft {
  border-color: var(--water-line);
  background: var(--water-soft);
}

.card h3,
.form-card h3,
.card h4,
.form-card h4 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.28;
  letter-spacing: -.08px;
}

.card p,
.form-card p,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.list {
  margin: 0 12px;
  overflow: hidden;
  border-radius: 18px;
}

.row {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--red-line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.row:last-child {
  border-bottom: 0;
}

.row.wide,
.row:has(.avatar) {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--red-main);
  font-size: 14px;
  font-weight: 900;
}

.row b {
  display: block;
  min-width: 0;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12.8px;
  line-height: 1.25;
  letter-spacing: -.05px;
}

.row span {
  color: var(--muted);
  font-size: 10.7px;
  line-height: 1.45;
}

.action:not(.pill) {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--red-line);
  border-radius: 999px;
  color: var(--red-main);
  background: #fff;
  font-size: 11px;
  font-weight: 900;
}

.action.primary:not(.pill) {
  color: #fff;
  border-color: var(--red-action);
  background: var(--red-action);
}

.action.red:not(.pill) {
  color: #fff;
  border-color: var(--red-action);
  background: var(--red-action);
}

.action.gold:not(.pill) {
  color: #775114;
  border-color: #F1DFAE;
  background: #FFF3D3;
}

.pill.action,
.pill.danger,
.pill.red {
  min-height: 21px;
  padding: 0 8px;
  border: 0;
  color: #fff;
  background: var(--red-action);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--red-line);
  border-radius: 12px;
  color: var(--ink);
  background: #FFF7F2;
  font-size: 12px;
  font-weight: 700;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.editable-list .row {
  align-items: start;
}

.editable-row b {
  margin-bottom: 7px;
}

.editable-row .pill {
  margin-top: 2px;
}

.edit-control {
  width: 100%;
  display: block;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid rgba(229, 184, 172, .92);
  border-radius: 11px;
  color: var(--ink);
  background: #FFF7F2;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.38;
  outline: none;
}

.edit-control:focus {
  border-color: var(--red-action);
  box-shadow: 0 0 0 3px rgba(196, 66, 50, .12);
}

.edit-control::placeholder {
  color: var(--muted);
  opacity: 1;
}

textarea.edit-control {
  min-height: 48px;
  resize: none;
}

.editable-card .edit-control + .edit-control {
  margin-top: 8px;
}

.select-panel {
  margin: -1px 10px 10px;
  padding: 9px;
  border: 1px solid rgba(229, 184, 172, .9);
  border-radius: 14px;
  background: rgba(255, 247, 242, .96);
}

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

.select-head b {
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.2;
}

.select-head span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 900;
}

.select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.select-option {
  min-height: 48px;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--red-line);
  border-radius: 12px;
  color: var(--red-main);
  background: #fff;
  text-align: center;
}

.select-option.on {
  color: #fff;
  border-color: var(--red-action);
  background: var(--red-action);
}

.select-option b {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 1000;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-option span {
  display: block;
  overflow: hidden;
  color: inherit;
  opacity: .76;
  font-size: 8.8px;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-box {
  margin: 10px 12px;
}

.search-control {
  width: 100%;
  height: 37px;
  min-height: 37px;
  padding: 0 14px;
  border: 1px solid var(--red-line);
  border-radius: 999px;
  color: var(--ink);
  background: #FFF7F2;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 37px;
  outline: none;
  appearance: none;
}

.search-control::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search-control:focus {
  border-color: var(--red-action);
  box-shadow: 0 0 0 3px rgba(196, 66, 50, .12);
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  border-top: 1px solid var(--red-line);
  background: rgba(255, 242, 234, .97);
}

.nav {
  min-width: 0;
  height: auto;
  padding: 0;
  position: relative;
  border: 0;
  text-align: center;
  color: #9A8B7C;
  background: transparent;
  font-size: 10px;
  font-weight: 900;
}

.nav i {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 4px;
  position: relative;
  color: currentColor;
  font-size: 0;
}

.nav.active {
  color: var(--red-main);
}

.ico-user:before {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.ico-user:after {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  width: 14px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.ico-message:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.ico-message:after {
  content: "";
  position: absolute;
  left: 8px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skew(-22deg);
}

.ico-wallet:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.ico-wallet:after {
  content: "";
  position: absolute;
  right: 3px;
  top: 10px;
  width: 6px;
  height: 5px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.ico-grid:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow:
    10px 0 0 -2px var(--card),
    10px 0 0 0 currentColor,
    0 10px 0 -2px var(--card),
    0 10px 0 0 currentColor,
    10px 10px 0 -2px var(--card),
    10px 10px 0 0 currentColor;
}

.ico-system:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.ico-system:after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    0 -9px 0 -1px currentColor,
    0 9px 0 -1px currentColor,
    -9px 0 0 -1px currentColor,
    9px 0 0 -1px currentColor;
}

.fixed-action {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 64px;
  padding: 9px 12px 13px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 9px;
  border-top: 1px solid var(--red-line);
  background: var(--red-soft);
}

.screen.action-fixed > .fixed-action {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 auto;
  z-index: 70;
}

.btn {
  height: 41px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: var(--wood-deep);
  background: var(--wood-soft);
  font-size: 12.5px;
  font-weight: 900;
}

.btn.primary {
  color: #fff;
  border-color: var(--red-action);
  background: var(--red-action);
}

.redbean-icon {
  width: .86em;
  height: .86em;
  margin-right: 2px;
  display: inline-block;
  vertical-align: -.08em;
  border: 1px solid rgba(134, 18, 32, .18);
  border-radius: 999px;
  background: #D71835;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.super-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 10;
  max-width: min(86vw, 360px);
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(92, 30, 24, .92);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.super-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 2026-05-31 SUPER visual closure: align with frozen CLIENT/EXPERT/CS operating language. */
.super-app *,
.super-app *::before,
.super-app *::after {
  letter-spacing: 0 !important;
}

.super-app {
  background: var(--earth);
}

.phone {
  border-radius: 42px;
  border-color: rgba(92, 30, 24, .88);
}

.screen {
  border-radius: 34px;
  background: var(--red-soft);
}

.screen.sub,
.screen-scroll,
.screen.action-fixed > .action-scroll {
  -webkit-overflow-scrolling: touch;
}

.top {
  padding: 14px 15px;
}

.top h1,
.top h3 {
  font-size: 20px;
  line-height: 1.18;
  font-weight: 1000;
}

.metrics {
  padding: 12px 14px;
  gap: 8px;
}

.metric {
  min-height: 62px;
  padding: 10px;
  border-color: var(--red-line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: none;
}

.list {
  padding: 12px 14px;
  gap: 8px;
}

.row,
.editable-row,
.select-row,
.customer-summary,
.funnel-panel,
.audit-card,
.env-card {
  border-color: var(--red-line);
  background: var(--card);
  box-shadow: none;
}

.row {
  min-height: 54px;
  padding: 9px 10px;
}

.row b,
.editable-row b,
.customer-summary h4,
.funnel-panel h4 {
  color: var(--red-ink);
  font-weight: 1000;
}

.row span,
.editable-row span,
.customer-summary span,
.funnel-panel span {
  color: var(--muted);
  font-weight: 850;
}

.search,
.edit-input,
.edit-textarea {
  border-color: var(--red-line);
  border-radius: 12px;
  background: #fff;
}

.bottom-nav {
  min-height: 66px;
  height: 66px;
  border-top: 1px solid var(--red-line);
  background: rgba(255, 249, 240, .98);
  box-shadow: 0 -8px 22px rgba(93, 50, 22, .08);
}

.bottom-nav .nav {
  min-width: 0;
}

.fixed-action {
  border-top: 1px solid var(--red-line);
  background: rgba(255, 249, 240, .98);
  box-shadow: 0 -8px 22px rgba(93, 50, 22, .08);
}

.super-customer-base-card {
  margin: 10px 12px 0;
  padding: 10px;
  border-radius: 14px;
}

.super-profile-head {
  min-height: 46px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}

.super-profile-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--red-action);
  font-size: 13px;
  font-weight: 1000;
}

.super-profile-head h4,
.super-profile-head span {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.super-profile-head h4 {
  margin: 0;
  color: var(--red-ink);
  font-size: 14px;
  line-height: 1.15;
  font-weight: 1000;
}

.super-profile-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}

.super-data-section {
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(229, 184, 172, .85);
  border-radius: 13px;
  background: #fff;
}

.super-data-section:first-of-type {
  margin-top: 0;
}

.super-data-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.super-data-title b {
  color: var(--red-ink);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 1000;
}

.super-data-title span {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 900;
  white-space: nowrap;
}

.super-profile-metrics {
  margin: 0 0 9px;
  gap: 7px;
}

.super-profile-metric {
  min-height: 50px;
  padding: 9px;
  border-radius: 12px;
}

.super-profile-metric b {
  font-size: 17px;
  line-height: 1;
}

.super-profile-metric span {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 900;
}

.super-profile-list {
  margin: 0;
  border-radius: 12px;
}

.super-profile-item {
  min-height: 44px;
  padding: 8px;
}

body #sourceFlowAcceptanceDock {
  bottom: -98px !important;
}

body #sourceFlowAcceptanceDock:hover,
body #sourceFlowAcceptanceDock:focus-within,
body #sourceFlowAcceptanceDock.is-open {
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
}
