:root {
  --ink: #17211d;
  --muted: #6e756f;
  --paper: #ffffff;
  --panel: #ffffff;
  --line: #e7e8e3;
  --green: #1f5d4a;
  --green-dark: #164435;
  --sage: #edf4ef;
  --sage-line: #cfded5;
  --warm: #f7f4ee;
  --warm-line: #e2d8c4;
  --select: #ffe6e9;
  --select-line: #f3c8ce;
  --lavender: #ecebe8;
  --result: #6a5735;
  --gold: #d7c494;
  --coral: #65736c;
  --blue: #315a7d;
  --button-primary: #8a7041;
  --button-primary-hover: #735c34;
  --button-secondary-bg: #f7f1e3;
  --button-secondary-border: #decda8;
  --button-secondary-hover: #efe4cd;
  --button-ghost-border: #e1d6bd;
  --chip-bg: #f3ecdc;
  --chip-border: #ded0ad;
  --chip-text: #6a5735;
  --mobile-record-card-bg: #fcfaf5;
  --mobile-record-card-border: rgba(226, 216, 196, 0.92);
  --mobile-record-card-shadow: 4px 6px 10px rgba(23, 33, 29, 0.045), 1px 2px 3px rgba(23, 33, 29, 0.025);
  --mobile-record-card-done-bg: #f4f1e8;
  --tool-tone-rose: #d85d73;
  --tool-tone-mint: #54b8ad;
  --tool-tone-plum: #8a547a;
  --tool-tone-sky: #4f87d9;
  --tool-tone-gold: #7d6ee0;
  --menu-icon-bg: #b08f57;
  --menu-icon-bg-strong: #8a7041;
  --menu-icon-shadow: 0 6px 14px rgba(23, 33, 29, 0.08);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

.boot-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--warm);
  transition: opacity 0.18s ease;
}

.boot-loading.is-hidden {
  pointer-events: none;
  opacity: 0;
}

.boot-loading-mark {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 24px;
}

.boot-loading-block {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--green);
  animation: boot-loading-wave 0.86s ease-in-out infinite;
}

.boot-loading-block:nth-child(2) {
  animation-delay: 0.12s;
}

.boot-loading-block:nth-child(3) {
  animation-delay: 0.24s;
}

.boot-loading-text {
  color: #496158;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

@keyframes boot-loading-wave {
  0%,
  100% {
    opacity: 0.42;
    transform: translateY(0);
  }

  45% {
    opacity: 1;
    transform: translateY(-9px);
  }
}

.auth-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 32px;
  padding: 4px 16px;
  background: transparent;
  color: #9aa1aa;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.6;
  white-space: nowrap;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0;
}

.app-shell:has(.workspace:not(.hidden)) {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.app-shell:has(.auth-panel:not(.hidden)) {
  width: min(1180px, 100%);
  padding: 28px;
}

.app-shell:has(.setup-panel:not(.hidden)) {
  width: min(980px, 100%);
  padding: 28px;
}

.setup-panel {
  display: grid;
  gap: 22px;
  max-width: 900px;
  margin: 7vh auto 24px;
  padding: 30px;
}

.setup-hero {
  display: grid;
  gap: 8px;
}

.setup-wizard {
  display: grid;
  gap: 18px;
}

.setup-steps {
  display: flex;
  gap: 10px;
}

.setup-steps-horizontal {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.setup-step {
  flex: 1 1 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 72px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 10px;
  text-align: left;
}

.setup-step.active,
.setup-step.done {
  background: rgba(31, 93, 74, 0.08);
  color: var(--green-dark);
}

.setup-step-index {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(233, 99, 77, 0.12);
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
}

.setup-step.active .setup-step-index,
.setup-step.done .setup-step-index {
  background: var(--green);
  color: white;
}

.setup-step strong,
.setup-step small {
  display: block;
}

.setup-step small {
  margin-top: 3px;
  color: var(--muted);
}

.setup-step-content {
  min-height: 220px;
  padding: 10px 2px;
}

.setup-banner {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 18px;
  color: var(--muted);
}

.setup-banner strong {
  color: var(--ink);
  font-size: 18px;
}

.setup-db-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.setup-db-details div {
  min-width: 0;
  border: 1px solid rgba(31, 93, 74, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  padding: 10px 12px;
}

.setup-db-details span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.setup-db-details code {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: inherit;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-banner-success {
  border-color: rgba(31, 93, 74, 0.42);
  background: rgba(31, 93, 74, 0.08);
}

.setup-banner-warning {
  border-color: rgba(233, 99, 77, 0.38);
  background: rgba(233, 99, 77, 0.08);
}

.setup-banner-info {
  border-color: rgba(49, 90, 125, 0.34);
  background: rgba(49, 90, 125, 0.08);
}

.setup-navigation,
.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.setup-navigation {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.setup-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.setup-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.setup-summary {
  display: grid;
  gap: 10px;
}

.setup-summary-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.setup-summary-item strong {
  font-size: 12px;
  color: var(--muted);
}

.setup-summary-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.setup-complete-preview {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.setup-complete-preview p {
  color: var(--muted);
}

.setup-check {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 26px;
  font-weight: 900;
}

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  column-gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  position: relative;
  display: block;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 56px);
  margin: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.auth-wordmark {
  margin: 0;
  color: #f04468;
  font-family: "Snell Roundhand", "Brush Script MT", cursive;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
}

.auth-brand {
  position: fixed;
  top: 28px;
  left: 28px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand img {
  display: block;
  width: 76px;
  height: auto;
  transform: translateX(-3px);
  filter: brightness(0) saturate(100%) invert(38%) sepia(85%) saturate(2163%) hue-rotate(319deg) brightness(99%) contrast(92%);
}

.auth-language-lines {
  position: absolute;
  top: 40%;
  right: 0;
  left: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(860px, calc(100% - 56px));
  margin-inline: auto;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 400;
  line-height: 1.18;
  text-align: center;
  transform: translateY(-50%);
}

.auth-language-lines p {
  width: 100%;
  margin: 0;
  opacity: 0.94;
  color: #5c6674;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  transform: translateY(0);
  transition:
    color 0.52s ease,
    opacity 0.52s ease,
    transform 0.52s ease;
}

.auth-language-lines.is-playing p {
  opacity: 0;
  transform: translateY(10px);
}

.auth-language-lines p:nth-child(1) {
  color: #1f2530;
}

.auth-language-lines p:nth-child(2) {
  color: #2b313c;
}

.auth-language-lines p:nth-child(3) {
  color: #39414d;
}

.auth-language-lines p:nth-child(4) {
  color: #4b5461;
}

.auth-language-lines p:nth-child(5) {
  color: #5c6674;
}

.auth-language-lines p.is-current {
  color: #1f2530;
  opacity: 1;
  transform: translateY(0);
}

.auth-language-lines p.is-dim {
  color: #89919c;
  opacity: 0.38;
  transform: translateY(0);
}

.auth-language-lines.is-settled p {
  opacity: 0.94;
  transform: translateY(0);
}

.brand-mark {
  position: relative;
  width: 76px;
  height: 76px;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  content: "";
  border-radius: 7px;
}

.brand-mark::before {
  inset: 12px 8px 8px;
  background: var(--green);
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.12);
}

.brand-mark::after {
  top: 4px;
  left: 4px;
  width: 68px;
  height: 18px;
  background: var(--gold);
  transform: rotate(-7deg);
}

.brand-mark span {
  left: 33px;
  top: 12px;
  width: 10px;
  height: 56px;
  background: var(--coral);
}

.eyebrow {
  margin: 0;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.lede {
  max-width: 420px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.auth-actions,
.pay-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#memberModal .pay-grid {
  display: grid;
  grid-template-columns: 1fr;
}

#memberModal .pay-grid .primary-btn,
#memberModal .pay-grid .secondary-btn {
  width: 100%;
}

.auth-actions {
  position: fixed;
  bottom: 48px;
  left: 50%;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
  justify-items: stretch;
  width: min(520px, calc(100vw - 56px));
  transform: translateX(-50%);
}

.admin-login-form {
  display: grid;
  gap: 10px;
  width: 100%;
}

.auth-secondary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  width: 100%;
}

.account-login-link {
  justify-self: center;
  min-height: auto;
  border: 0;
  background: transparent;
  color: rgba(183, 42, 80, 0.78);
  padding: 0;
  font-size: 14px;
  font-weight: 800;
}

.account-login-link:hover {
  color: #b72a50;
}

.miniprogram-skip-login {
  display: block;
  margin: 2px auto 0;
}

.auth-agreement-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #8f9691;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
  flex: 1 1 260px;
}

.auth-agreement-note input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 1px solid #f04468;
  border-radius: 3px;
  background: #ffffff;
  accent-color: #f04468;
}

.auth-agreement-note input:checked {
  background: #f04468;
}

.auth-agreement-note input:checked::after {
  width: 8px;
  height: 5px;
  border: solid #ffffff;
  border-width: 0 0 2px 2px;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.auth-agreement-note button {
  border: 0;
  background: transparent;
  color: #f04468;
  padding: 0 1px;
  font: inherit;
  font-weight: 900;
}

.auth-agreement-note button:hover {
  color: #b72a50;
}

.admin-login-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(240, 68, 104, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.admin-login-form input:focus {
  border-color: rgba(240, 68, 104, 0.52);
  box-shadow: 0 0 0 3px rgba(240, 68, 104, 0.1);
}

.account-login-card {
  gap: 18px;
}

.account-login-card .primary-btn {
  width: 100%;
}

.auth-actions .primary-btn {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
}

.auth-actions .primary-btn {
  background: #ff5f86;
  color: white;
  box-shadow: 0 10px 24px rgba(240, 68, 104, 0.16);
}

.auth-actions .primary-btn:hover {
  background: #e9476f;
  color: white;
}

.auth-actions .primary-btn:disabled {
  cursor: not-allowed;
  background: #f5a5b8;
  color: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.auth-role-strip {
  position: fixed;
  right: 0;
  bottom: 174px;
  left: 0;
  z-index: 7;
  display: grid;
  gap: 8px;
  overflow: hidden;
  padding: 4px 0;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 44%, #000 56%, transparent);
}

.auth-role-track {
  display: flex;
  width: max-content;
  gap: 10px;
  animation: roleMarquee 28s linear infinite;
}

.auth-role-track-b {
  animation-duration: 34s;
  animation-direction: reverse;
  transform: translateX(-120px);
}

.auth-role-track-c {
  animation-duration: 31s;
  transform: translateX(-240px);
}

.auth-role-track span {
  flex: 0 0 auto;
  border: 1px solid #ffd0dc;
  border-radius: 999px;
  background: #fff4f7;
  color: #f04468;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

@keyframes roleMarquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-role-track {
    animation: none;
  }
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--button-primary);
  color: white;
}

.primary-btn:hover {
  background: var(--button-primary-hover);
}

.secondary-btn {
  padding: 0 18px;
  background: var(--button-secondary-bg);
  border: 1px solid var(--button-secondary-border);
  color: var(--ink);
}

.secondary-btn:hover {
  background: var(--button-secondary-hover);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: #f1f1ec;
  border-color: #deded6;
  color: #8f948d;
}

.primary-btn:disabled:hover,
.secondary-btn:disabled:hover,
.ghost-btn:disabled:hover {
  background: #f1f1ec;
}

.ghost-btn {
  padding: 0 18px;
  background: #ffffff;
  border: 1px solid var(--button-ghost-border);
  color: var(--ink);
}

.ghost-btn:hover,
.chip:hover,
.box-item:hover,
.history-item:hover {
  background: #fbf7ee;
}

.compact {
  min-height: 40px;
  padding-inline: 14px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  background: var(--ink);
  color: white;
}

.tool-rail {
  position: relative;
  left: 0;
  z-index: 4;
  grid-column: 1;
  grid-row: 1 / 99;
  display: grid;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 4px 0 5px;
  background: #ffffff;
  border-right: 1px solid #dedfdb;
  box-shadow: none;
  backdrop-filter: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c8cbc7 transparent;
  scrollbar-width: thin;
}

.tool-rail::-webkit-scrollbar {
  width: 4px;
}

.tool-rail::-webkit-scrollbar-track {
  background: transparent;
}

.tool-rail::-webkit-scrollbar-thumb {
  background: #c8cbc7;
  border-radius: 999px;
}

.tool-rail-toggle {
  display: none;
}

.rail-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 10px 0;
  padding: 5px 8px 0;
  text-decoration: none;
}

.rail-brand img {
  display: block;
  width: min(76px, 100%);
  height: auto;
  transform: translateX(-3px);
  filter: brightness(0) saturate(100%) invert(38%) sepia(85%) saturate(2163%) hue-rotate(319deg) brightness(99%) contrast(92%);
}

.main-scroll {
  grid-column: 2;
  grid-row: 1 / 99;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
}

.tool-nav {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.tool-nav-loading {
  margin: 10px 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tool-nav-group {
  display: grid;
  gap: 4px;
  border: 1px solid #dfeae3;
  border-radius: 16px;
  background: #f7fbf8;
  padding: 0;
}

.tool-nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 7px 8px;
  text-align: left;
}

.tool-nav-item:hover,
.tool-nav-item.active {
  color: var(--green-dark);
}

.tool-nav-item.active {
  background: var(--select);
  border-color: var(--select-line);
  color: var(--ink);
}

.tool-nav-item.active .tool-copy strong {
  font-weight: 900;
}

.archived-tool-group {
  padding: 4px;
}

.archived-tool-summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  padding: 9px 10px;
}

.archived-tool-summary::-webkit-details-marker {
  display: none;
}

.archived-tool-summary::after {
  content: "展开";
  float: right;
  color: #8b9298;
  font-size: 12px;
  font-weight: 700;
}

.archived-tool-group[open] .archived-tool-summary::after {
  content: "收起";
}

.tool-nav-item.archived {
  opacity: 0.78;
}

.archived-tool-empty {
  margin: 4px 10px 8px;
  color: #8b9298;
  font-size: 12px;
  line-height: 1.5;
}

.tool-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--menu-icon-bg);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    var(--menu-icon-shadow);
}

.tool-index svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.tool-index.tone-rose,
.tool-index.tone-mint,
.tool-index.tone-plum,
.tool-index.tone-sky,
.tool-index.tone-gold {
  background: var(--menu-icon-bg);
}

.tool-nav-item.active .tool-index {
  background: var(--menu-icon-bg-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(23, 33, 29, 0.12);
}

.tool-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.tool-copy strong,
.tool-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.tool-copy small,
.tool-badge {
  display: none;
}

.tool-badge {
  position: absolute;
  right: 7px;
  bottom: 5px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 900;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 2px 22px;
}

.topbar-title-row {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-back-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink);
  padding: 0;
}

.topbar-back-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.mobile-bottom-nav {
  display: none;
}

.miniprogram-contact-float {
  position: fixed;
  right: 16px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 70;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: #111814;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  box-shadow: 0 16px 36px rgba(17, 24, 20, 0.24);
  -webkit-tap-highlight-color: transparent;
}

.miniprogram-contact-float.hidden {
  display: none;
}

.mobile-top-logo {
  display: none;
}

.mobile-nav-btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #a8aaa7;
  padding: 6px 10px;
  font-weight: 900;
  box-shadow: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-btn span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 24px;
  line-height: 1;
}

.mobile-admin-icon svg,
.mobile-home-icon svg,
.mobile-user-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.mobile-nav-btn strong {
  font-size: 14px;
  line-height: 1;
}

.mobile-nav-btn.active,
.mobile-nav-btn:not(.hidden):active,
.mobile-nav-btn:focus,
.mobile-nav-btn:focus-visible {
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  color: var(--menu-icon-bg-strong);
}

.admin-menu-btn,
.avatar-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #8f6df6;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.admin-menu-btn {
  border: 1px solid rgba(240, 68, 104, 0.22);
  background: #ffffff;
  color: #f04468;
}

.admin-menu-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.admin-menu-btn:hover {
  border-color: rgba(240, 68, 104, 0.42);
  background: #fff2f5;
}

.avatar-btn:hover {
  background: #7d5ff0;
}

.avatar-btn.has-avatar {
  overflow: hidden;
  border: 1px solid rgba(143, 109, 246, 0.18);
  background: #ffffff;
}

.avatar-btn.has-avatar:hover {
  background: #ffffff;
}

.avatar-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-menu,
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 8;
  display: grid;
  min-width: 128px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.1);
}

.admin-menu {
  right: 52px;
  min-width: 138px;
}

.admin-menu-item,
.user-menu-item {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 14px;
  text-align: left;
  font-weight: 800;
}

.admin-menu-item:hover,
.user-menu-item:hover {
  background: #f7f7f4;
}

.user-menu-item.danger {
  color: #8a1757;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 22px;
}

.topbar-lede {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.quick-create {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eeeeea;
}

.admin-page-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-page-grid-two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-page-grid-three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-stat-card,
.admin-page-panel {
  min-width: 0;
  max-width: 100%;
  padding: 18px;
}

.admin-page-panel {
  overflow: hidden;
}

.admin-stat-card {
  display: grid;
  gap: 8px;
}

.admin-stat-card span,
.admin-page-copy,
.admin-setting-list span,
.admin-user-table span {
  color: var(--muted);
  font-weight: 800;
}

.admin-stat-card strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.admin-action-list,
.admin-setting-list {
  display: grid;
  gap: 10px;
}

.admin-action-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-setting-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  padding: 0 14px;
}

.admin-user-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.admin-time-range {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8f5;
  margin: 0 0 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.admin-time-range::-webkit-scrollbar {
  display: none;
}

.admin-time-range button {
  flex: 0 0 auto;
  min-width: 54px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.admin-time-range button:last-child {
  border-right: 0;
}

.admin-time-range button.active {
  background: var(--green);
  color: #ffffff;
}

.admin-search-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.admin-search-field {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
  flex: 1 1 320px;
}

.admin-search-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-search-field input {
  width: 100%;
  text-transform: uppercase;
}

.admin-user-table {
  width: 100%;
  min-width: 1360px;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-users-table {
  min-width: 1640px;
}

.admin-demand-table {
  min-width: 980px;
}

.admin-recharge-table {
  min-width: 1180px;
}

.admin-behavior-top-table {
  min-width: 760px;
}

.admin-invite-table {
  min-width: 900px;
}

.admin-behavior-table {
  min-width: 1080px;
}

.admin-behavior-top-table th:nth-child(1),
.admin-behavior-top-table td:nth-child(1) { width: 48%; }
.admin-behavior-top-table th:nth-child(2),
.admin-behavior-top-table td:nth-child(2) { width: 28%; }
.admin-behavior-top-table th:nth-child(3),
.admin-behavior-top-table td:nth-child(3) { width: 24%; }

.admin-behavior-table th:nth-child(1),
.admin-behavior-table td:nth-child(1) { width: 180px; }
.admin-behavior-table th:nth-child(2),
.admin-behavior-table td:nth-child(2) { width: 200px; }
.admin-behavior-table th:nth-child(3),
.admin-behavior-table td:nth-child(3) { width: 260px; }
.admin-behavior-table th:nth-child(4),
.admin-behavior-table td:nth-child(4) { width: 120px; }
.admin-behavior-table th:nth-child(5),
.admin-behavior-table td:nth-child(5) { width: 320px; }

.admin-invite-table th:nth-child(1),
.admin-invite-table td:nth-child(1) { width: 180px; }
.admin-invite-table th:nth-child(2),
.admin-invite-table td:nth-child(2) { width: 180px; }
.admin-invite-table th:nth-child(3),
.admin-invite-table td:nth-child(3) { width: 120px; }
.admin-invite-table th:nth-child(4),
.admin-invite-table td:nth-child(4) { width: 140px; }
.admin-invite-table th:nth-child(5),
.admin-invite-table td:nth-child(5) { width: 120px; }
.admin-invite-table th:nth-child(6),
.admin-invite-table td:nth-child(6) { width: 180px; }

.admin-user-table th,
.admin-user-table td {
  border-bottom: 1px solid var(--line);
  padding: 16px 12px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.admin-user-table th {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  background: #fbfbf8;
}

.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) { width: 160px; }
.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) { width: 210px; }
.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) { width: 140px; }
.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) { width: 160px; }
.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) { width: 120px; }
.admin-users-table th:nth-child(6),
.admin-users-table td:nth-child(6) { width: 180px; }
.admin-users-table th:nth-child(7),
.admin-users-table td:nth-child(7) { width: 170px; }
.admin-users-table th:nth-child(8),
.admin-users-table td:nth-child(8) { width: 120px; }
.admin-users-table th:nth-child(9),
.admin-users-table td:nth-child(9) { width: 230px; }
.admin-users-table th:nth-child(10),
.admin-users-table td:nth-child(10) { width: 120px; }
.admin-users-table th:nth-child(11),
.admin-users-table td:nth-child(11) { width: 76px; }

.admin-users-table th:last-child,
.admin-users-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: -10px 0 18px rgba(23, 33, 29, 0.05);
}

.admin-users-table th:last-child {
  z-index: 3;
  background: #fbfbf8;
}

.admin-user-table td {
  color: var(--ink);
}

.admin-user-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-user-table strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.admin-user-subtext {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: #f4f5f2;
  color: var(--green-dark);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 900;
}

.admin-user-pill.is-admin {
  background: #efe6ff;
  color: #7a50d1;
}

.admin-user-pill.is-ok {
  background: #e8f5ea;
  color: #1e6a3d;
}

.admin-user-pill.is-warn {
  background: #fff3d8;
  color: #8a5b00;
}

.admin-user-pill.is-danger {
  background: #fde8e8;
  color: #a12b2b;
}

.admin-table-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f6f4;
  color: var(--ink);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 900;
}

.admin-table-action-danger {
  border-color: rgba(196, 47, 47, 0.18);
  background: #fff1f1;
  color: #a12b2b;
}

.admin-user-action-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.admin-user-action-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
}

.admin-user-action-text {
  display: none;
}

.admin-link-button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 0;
  border-bottom: 2px solid currentColor;
  background: transparent;
  color: var(--green-dark);
  padding: 0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.admin-recharge-dialog {
  width: min(1280px, calc(100vw - 56px));
  max-height: min(60vh, 520px);
  overflow: auto;
  text-align: left;
  margin-top: 0;
}

.admin-recharge-dialog .admin-user-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-recharge-dialog .admin-user-table,
.admin-recharge-dialog .admin-user-table thead,
.admin-recharge-dialog .admin-user-table tbody,
.admin-recharge-dialog .admin-user-table tr,
.admin-recharge-dialog .admin-user-table th,
.admin-recharge-dialog .admin-user-table td {
  display: revert;
}

.admin-recharge-dialog .admin-user-table thead {
  display: table-header-group;
}

.admin-recharge-dialog .admin-user-table tbody {
  display: table-row-group;
}

.admin-recharge-dialog .admin-user-table tr {
  display: table-row;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.admin-recharge-dialog .admin-user-table th,
.admin-recharge-dialog .admin-user-table td {
  display: table-cell;
}

.admin-recharge-dialog .admin-user-table td::before {
  display: none;
}

.admin-recharge-dialog-table {
  min-width: 1180px;
}

.admin-recharge-dialog .admin-recharge-table th,
.admin-recharge-dialog .admin-recharge-table td {
  padding: 12px 10px;
  font-size: 13px;
}

.admin-recharge-dialog .admin-recharge-table strong {
  font-size: 15px;
}

.admin-status-select {
  width: auto;
  min-width: 116px;
  min-height: 36px;
  border-radius: 999px;
  font-weight: 900;
}

.admin-empty-row {
  color: var(--muted);
  padding: 24px 16px;
  text-align: center;
}

.agreement-editor {
  display: grid;
  gap: 16px;
}

.agreement-editor label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.agreement-editor textarea {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
  color: var(--ink);
  resize: vertical;
}

.agreement-editor-actions {
  display: flex;
  justify-content: flex-end;
}

.system-settings-panel {
  padding: 24px;
}

.system-settings-form {
  display: grid;
  gap: 18px;
}

.system-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.system-settings-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.3;
}

.system-settings-head p {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.system-setting-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(31, 93, 74, 0.18);
  border-radius: 999px;
  background: #f4faf6;
  color: var(--sage);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.system-setting-field {
  display: grid;
  gap: 8px;
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.system-setting-field-wide {
  max-width: 560px;
}

.system-setting-field-row {
  display: grid;
  grid-template-columns: minmax(280px, 560px) minmax(180px, 260px);
  gap: 12px;
  align-items: end;
}

.system-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
}

.system-choice-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  padding: 14px;
  cursor: pointer;
}

.system-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.system-choice-card i {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid #c8d2cc;
  border-radius: 6px;
  background: #ffffff;
}

.system-choice-card i::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg);
}

.system-choice-card span {
  display: grid;
  gap: 4px;
}

.system-choice-copy {
  display: grid;
  gap: 4px;
}

.system-choice-card strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.system-choice-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.system-choice-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  background: #fff2cf;
  color: #8a7041;
  padding: 0 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.system-choice-card:has(input:checked) {
  border-color: rgba(49, 179, 74, 0.38);
  background: #f4faf6;
}

.system-choice-card input:checked + i {
  border-color: #31b34a;
  background: #31b34a;
}

.system-choice-card input:checked + i::after {
  opacity: 1;
}

.system-choice-card:has(input:focus-visible) {
  border-color: var(--sage-line);
  box-shadow: 0 0 0 3px rgba(31, 93, 74, 0.07);
}

.system-setting-field select {
  min-height: 40px;
  font-weight: 800;
}

.system-setting-field input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  font: inherit;
  font-weight: 800;
}

.system-settings-group {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.system-settings-group-head {
  display: grid;
  gap: 4px;
}

.system-settings-group-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.system-settings-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.virtual-pay-product-list {
  display: grid;
  gap: 10px;
}

.virtual-pay-product-row {
  display: grid;
  grid-template-columns: 72px minmax(160px, 220px) minmax(220px, 1fr) minmax(140px, 180px) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.virtual-pay-product-active {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  position: relative;
  width: 72px;
  min-height: 40px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.virtual-pay-product-active .virtual-pay-radio,
.virtual-pay-product-active input.virtual-pay-radio[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.virtual-pay-radio-dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1px solid var(--sage-line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 0 0 4px #ffffff;
}

.virtual-pay-product-active .virtual-pay-radio:checked + .virtual-pay-radio-dot {
  border-color: #0b7cff;
  background: #0b7cff;
}

.virtual-pay-product-amount {
  max-width: none;
}

.virtual-pay-empty {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.system-setting-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.system-setting-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  padding: 12px 14px;
  cursor: pointer;
}

.system-setting-toggle span {
  display: grid;
  gap: 3px;
}

.system-setting-toggle strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.system-setting-toggle small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.system-setting-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.system-setting-toggle i {
  position: relative;
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #ececea;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 29, 0.04);
  transition: background 0.18s ease;
}

.system-setting-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(23, 33, 29, 0.16);
  transition: transform 0.18s ease;
}

.system-setting-toggle input:checked + i {
  background: #31b34a;
}

.system-setting-toggle input:checked + i::after {
  transform: translateX(18px);
}

.system-setting-toggle:has(input:focus-visible) {
  border-color: var(--sage-line);
  box-shadow: 0 0 0 3px rgba(31, 93, 74, 0.07);
}

.system-setting-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.system-setting-status {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  padding: 12px 14px;
}

.system-setting-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.system-setting-status strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.system-settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.system-settings-actions .primary-btn {
  width: auto;
  min-width: 96px;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
}

.template-editor-card {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, 88vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.template-editor-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.template-editor-row {
  position: relative;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfbf8;
}

.template-name-input,
.template-options-input {
  width: 100%;
}

.template-name-input {
  padding-right: 62px;
}

.template-options-input {
  min-height: 104px;
  padding: 12px 14px;
  line-height: 1.55;
  resize: vertical;
}

.template-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.template-delete-btn {
  position: absolute;
  top: 19px;
  right: 18px;
  min-height: auto;
  padding: 0;
}

.system-dialog-card {
  width: min(520px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.system-dialog-card.system-dialog-recharge-detail {
  width: min(1320px, calc(100vw - 32px));
}

.app-message-toast {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  max-width: calc(100vw - 32px);
  border: 1px solid #dfeae3;
  border-radius: 8px;
  background: #f4fbf5;
  color: #4f7f43;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(23, 33, 29, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.app-message-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.system-dialog-message {
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
  white-space: pre-wrap;
  overscroll-behavior: contain;
}

.system-dialog-prompt-hint {
  flex: 0 0 auto;
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-wrap;
}

.system-dialog-form .system-dialog-message {
  max-height: min(220px, 28vh);
  padding-right: 4px;
}

.system-dialog-recharge-detail {
  width: min(520px, calc(100vw - 32px));
  min-height: auto;
}

.system-dialog-recharge-detail .system-dialog-message {
  flex: 0 1 auto;
  display: block;
  align-self: stretch;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  padding-top: 4px;
  white-space: normal;
}

.data-security-copy {
  margin: 0;
}

.data-security-cancel-link {
  border: 0;
  background: transparent;
  color: #9a3412;
  display: block;
  margin: 8px 0 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.data-security-cancel-link:hover {
  color: #7c2d12;
  text-decoration: underline;
}

.data-security-cancel-link:disabled {
  color: #b9b9b9;
  cursor: not-allowed;
  text-decoration: none;
}

.system-dialog-links {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.system-dialog-link-separator {
  color: #8f9691;
  font-weight: 800;
}

.system-dialog-card input {
  margin: 0;
}

.system-dialog-prompt-with-hint #systemDialogInput {
  margin-bottom: -6px;
}

.system-dialog-textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px 14px;
  color: var(--ink);
  resize: vertical;
}

.system-dialog-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.system-dialog-checkbox input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
}

.system-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.system-dialog-login .system-dialog-actions {
  order: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.system-dialog-login #systemDialogConfirmBtn {
  width: 100%;
}

.system-dialog-login .system-dialog-checkbox {
  order: 4;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: #8f9691;
  font-size: 11px;
  line-height: 1.6;
  white-space: normal;
  overflow: visible;
}

.system-dialog-login #systemDialogConsentText {
  flex: 0 0 auto;
  white-space: nowrap;
}

.system-dialog-login .system-dialog-links {
  display: inline-flex;
  flex: 0 1 auto;
  gap: 2px;
  margin-left: 0;
  min-width: 0;
  white-space: nowrap;
}

.system-dialog-login .system-dialog-links .text-btn {
  min-height: auto;
  padding: 0;
  line-height: inherit;
}

.password-card {
  gap: 18px;
}

.password-form {
  gap: 14px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.quick-create .input-row,
.option-editor .input-row {
  align-items: stretch;
  flex-direction: row;
}

.quick-create .input-row .primary-btn,
.option-editor .input-row .secondary-btn {
  flex: 0 0 82px;
  min-width: 82px;
  white-space: nowrap;
}

.quick-create > .primary-btn {
  flex: 0 0 auto;
  min-width: 78px;
  white-space: nowrap;
}

input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: transparent;
  opacity: 0;
}

.auth-agreement-note input[type="checkbox"] {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
}

select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

select {
  min-height: 44px;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 28px) 50%, calc(100% - 21px) 50%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

input[type="date"] {
  padding-right: 12px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.75;
}

textarea {
  min-height: 98px;
  padding-block: 12px;
  resize: vertical;
}

.invite-code-field {
  display: grid;
  gap: 8px;
  margin: 14px 0 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.invite-code-field input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  text-transform: uppercase;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage-line);
  box-shadow: 0 0 0 3px rgba(31, 93, 74, 0.07);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 auto;
  gap: 8px;
  overflow-x: visible;
  padding-bottom: 0;
}

.chip {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  padding: 0 13px;
  font-weight: 800;
}

.chip.active {
  border-color: var(--select-line);
  background: var(--select);
  color: var(--ink);
}

.template-edit-chip {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.template-edit-chip svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-icon-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  padding: 0;
}

.tool-icon-btn:hover {
  border-color: var(--button-secondary-border);
  background: var(--button-secondary-hover);
  color: var(--button-primary-hover);
}

.tool-icon-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-icon-delete {
  color: #9a5a4b;
}

.tool-icon-save {
  border-color: var(--button-primary);
  background: var(--button-primary);
  color: white;
}

.tool-icon-save:hover {
  border-color: var(--button-primary-hover);
  background: var(--button-primary-hover);
  color: white;
}

.tool-title-action {
  margin-left: auto;
}

.tool-title-text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 30px;
  min-width: 0;
  width: auto;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #e4dac6;
  background: #fbf8f2;
  color: #75654a;
  box-shadow: none;
  white-space: nowrap;
}

.tool-title-text-action:hover {
  border-color: #dacdad;
  background: #f4ede0;
  color: #6a5735;
}

.draw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.tool-page {
  display: grid;
  gap: 18px;
  padding-bottom: 22px;
}

.tool-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
}

.tool-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.tool-summary-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 108px;
  border-color: var(--summary-border, var(--line));
  background: linear-gradient(180deg, var(--summary-bg, #ffffff) 0%, #ffffff 100%);
  padding: 16px 18px;
}

.tool-summary-card:nth-child(4n + 1) {
  --summary-bg: #f3f8f4;
  --summary-border: #d9e7dc;
  --summary-accent: #2f6b4f;
}

.tool-summary-card:nth-child(4n + 2) {
  --summary-bg: #f3f7fa;
  --summary-border: #d8e4ec;
  --summary-accent: #37677f;
}

.tool-summary-card:nth-child(4n + 3) {
  --summary-bg: #faf7ef;
  --summary-border: #e9dec6;
  --summary-accent: #8a6a2f;
}

.tool-summary-card:nth-child(4n + 4) {
  --summary-bg: #faf3f2;
  --summary-border: #ead7d3;
  --summary-accent: #9a5a52;
}

.tool-summary-card span {
  display: block;
  color: var(--summary-accent, var(--muted));
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.tool-summary-card strong {
  display: block;
  color: var(--summary-accent, var(--ink));
  font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(24px, 2.4vw, 32px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tool-summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tool-summary-card.tone-warn {
  --summary-bg: #fff9f0;
  --summary-border: #eadcc8;
  --summary-accent: #8a6a2f;
}

.tool-summary-card.tone-good {
  --summary-bg: #f2fbf5;
  --summary-border: #d7eadc;
  --summary-accent: #2f6b4f;
}

.tool-summary-card.tone-bad {
  --summary-bg: #fff4f1;
  --summary-border: #ead6cf;
  --summary-accent: #9a5a52;
}

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

.period-summary-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 92px;
  border-color: var(--summary-border, var(--line));
  background: linear-gradient(180deg, var(--summary-bg, #ffffff) 0%, #ffffff 100%);
  padding: 12px 16px;
}

.period-summary-card:nth-child(4n + 1) {
  --summary-bg: #f3f8f4;
  --summary-border: #d9e7dc;
  --summary-accent: #2f6b4f;
}

.period-summary-card:nth-child(4n + 2) {
  --summary-bg: #f3f7fa;
  --summary-border: #d8e4ec;
  --summary-accent: #37677f;
}

.period-summary-card:nth-child(4n + 3) {
  --summary-bg: #faf7ef;
  --summary-border: #e9dec6;
  --summary-accent: #8a6a2f;
}

.period-summary-card:nth-child(4n + 4) {
  --summary-bg: #faf3f2;
  --summary-border: #ead7d3;
  --summary-accent: #9a5a52;
}

.period-summary-card span,
.period-summary-card strong,
.period-summary-card small {
  display: block;
  min-width: 0;
}

.period-summary-card span {
  color: var(--summary-accent, var(--muted));
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 8px;
}

.period-summary-card strong {
  color: var(--summary-accent, var(--ink));
  font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(24px, 2.4vw, 32px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.05;
  white-space: normal;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
}

.period-summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  margin: 0;
}

.tool-period-overview {
  padding: 16px 18px;
}

.tool-period-overview-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-period-overview-item {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.tool-period-overview-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.tool-period-overview-item strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tool-period-overview-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.tool-period-overview-item-wide {
  grid-column: 1 / -1;
}

.tool-trend {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 12px 16px 10px;
}

.tool-trend-stats {
  display: grid;
  grid-template-columns: repeat(var(--tool-trend-stat-columns, 2), minmax(0, 1fr));
  gap: 32px;
  align-items: end;
  padding: 6px 10px 0;
}

.tool-trend-stat {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tool-trend-stat:nth-child(2) {
  justify-items: end;
  text-align: right;
}

.tool-trend-stat strong {
  color: var(--ink);
  font-family: "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(26px, 3vw, 36px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.tool-trend-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.life-timeline-panel {
  display: grid;
  gap: 14px;
  min-height: 286px;
}

.life-timeline-stats {
  padding: 6px 10px 0;
}

.life-timeline-stats .tool-trend-stat {
  justify-items: start;
  text-align: left;
}

.life-timeline-stats .tool-trend-stat:nth-child(2) {
  justify-items: end;
  text-align: right;
}

.life-timeline-head {
  justify-content: flex-end;
}

.life-timeline-tools {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-right: 16px;
}

.life-timeline-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.life-timeline-panel > .tool-chart-empty {
  min-height: 220px;
}

.life-timeline-filters {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.life-timeline-filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid #e6dcc9;
  border-radius: 999px;
  background: #fffdf8;
  color: #6f746f;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 900;
}

.life-timeline-filters button.active {
  border-color: var(--life-person-color, var(--green));
  background: #f8fbf8;
  color: var(--life-person-color, var(--green));
  border-color: color-mix(in srgb, var(--life-person-color, var(--green)) 58%, #ffffff);
  background: color-mix(in srgb, var(--life-person-color, var(--green)) 16%, #ffffff);
}

.life-timeline-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--life-person-color, var(--green));
  flex: 0 0 auto;
}

.life-timeline {
  position: relative;
  display: flex;
  gap: 0;
  align-items: stretch;
  min-width: 0;
  min-height: 220px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 74px 8px 32px;
}

.life-timeline::before {
  display: none;
}

.life-timeline-item {
  position: relative;
  display: grid;
  grid-template-rows: 34px 18px auto;
  justify-items: center;
  align-items: start;
  flex: 0 0 180px;
  min-width: 180px;
  padding: 0 12px;
  text-align: center;
}

.life-timeline-item::before {
  content: "";
  position: absolute;
  top: 42px;
  right: 0;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: #dfe5dc;
}

.life-timeline-marker {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--life-person-color, var(--green)) 34%, #ffffff);
  border-radius: 999px;
  background: var(--life-person-color, var(--green));
  box-shadow: 0 0 0 3px #fffdf8;
}

.life-timeline-date {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.life-timeline-node {
  min-width: 0;
  max-width: 160px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tool-trend-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.tool-trend-head-left {
  display: flex;
  flex: 1 1 240px;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
}

.tool-trend-dimensions {
  display: inline-flex;
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #e6dcc9;
  border-radius: 999px;
  background: #fbf8f2;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tool-trend-dimensions::-webkit-scrollbar {
  display: none;
}

.tool-trend-dimensions button {
  flex: 0 0 auto;
  min-width: 46px;
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid #ebe2d1;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.tool-trend-dimensions button:last-child {
  border-right: 0;
}

.tool-trend-dimensions button.active {
  background: #f1f6f2;
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px #cbdcd3;
}

.time-fragment-scopes {
  max-width: 100%;
}

.time-fragment-scopes button {
  min-width: 58px;
}

.time-fragment-panel {
  min-height: 0;
}

.time-fragment-stats {
  padding-bottom: 2px;
}

.time-fragment-head > .time-fragment-scopes {
  margin-left: 0;
}

.time-fragment-head {
  justify-content: space-between;
}

.time-fragment-chart-scroll {
  padding: 10px;
}

.time-fragment-chart {
  display: grid;
  min-height: 220px;
  place-items: center;
}

.time-fragment-chart > .tool-chart-empty {
  width: 100%;
  min-height: 220px;
}

.time-fragment-vchart {
  height: 220px;
}

.tool-trend-types {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
}

.tool-trend-type-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid #e6dcc9;
  border-radius: 999px;
  background: #fbf8f2;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.tool-trend-type-trigger:hover {
  border-color: #d6cbb5;
  background: #f4ede0;
}

.tool-trend-series {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.tool-trend-series button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e6dcc9;
  border-radius: 999px;
  background: #fbf8f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.tool-trend-series button.active {
  border-color: #cbdcd3;
  background: #f1f6f2;
  color: var(--green-dark);
}

.tool-trend-series button:disabled {
  opacity: 1;
  cursor: default;
}

.tool-trend-series-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--trend-series-color, var(--green));
  flex: 0 0 auto;
}

.tool-trend-series-select {
  display: none;
  flex: 0 0 auto;
  min-width: 0;
}

.tool-trend-series-select select {
  max-width: 118px;
  height: 30px;
  padding: 0 28px 0 14px;
  border: 1px solid #e6dcc9;
  border-radius: 999px;
  background: #fbf8f2;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 30px;
  text-align: center;
  text-align-last: center;
  appearance: none;
  -webkit-appearance: none;
}

.tool-trend-scope select {
  min-width: 110px;
  height: 30px;
  padding: 0 28px 0 12px;
  border: 1px solid #e6dcc9;
  border-radius: 999px;
  background: #fbf8f2;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.tool-dashboard-refined {
  grid-template-columns: minmax(0, 1fr);
}

.tool-chart-stack {
  display: grid;
  gap: 10px;
}

.tool-vchart-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(250, 247, 240, 0.58) 0%, rgba(247, 243, 235, 0.42) 100%);
  padding: 10px 10px 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tool-vchart-scroll::-webkit-scrollbar {
  display: none;
}

.tool-vchart {
  width: 100%;
  height: 220px;
  min-width: 0;
  overflow: hidden;
  position: relative;
  background: transparent;
}

.tool-vchart > div,
.tool-vchart canvas,
.tool-vchart svg {
  background: transparent !important;
}

.tool-chart-loading,
.tool-chart-empty {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tool-chart-empty {
  border: 1px dashed rgba(207, 222, 213, 0.9);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(247, 250, 247, 0.8), rgba(255, 255, 255, 0.92));
}

.tool-vchart:has(.tool-chart-empty),
.tool-vchart:has(.tool-chart-loading) {
  min-width: 0 !important;
}

.tool-light-mode {
  width: fit-content;
  border: 1px solid var(--warm-line);
  border-radius: 999px;
  background: var(--warm);
  color: #78684b;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.tool-progress {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  padding: 12px;
}

.tool-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tool-progress-head strong {
  color: var(--ink);
}

.tool-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ece6;
}

.tool-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.tool-hero-number {
  display: grid;
  justify-items: start;
  border: 1px solid var(--sage-line);
  border-radius: 8px;
  background: var(--sage);
  padding: 14px;
}

.tool-hero-number span,
.tool-hero-number small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tool-hero-number strong {
  color: var(--green-dark);
  font-size: 44px;
  line-height: 1;
}

.tool-content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
}

.tool-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.tool-action-bar .primary-btn,
.tool-action-bar .secondary-btn,
.tool-action-bar .ghost-btn {
  width: auto;
}

.tool-action-bar .ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tool-main-stack {
  display: grid;
  align-content: start;
  gap: 12px;
}

.tool-draft-actions {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  padding: 14px;
}

.tool-draft-actions > div {
  display: grid;
  gap: 6px;
}

.tool-draft-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tool-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-editor,
.tool-records {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

.tool-module-editor .section-title,
.tool-module-records .section-title {
  align-items: center;
}

.tool-module-records {
  padding: 0;
  gap: 0;
}

.tool-module-records.panel {
  border: 0;
  box-shadow: none;
}

.tool-module-records .section-title {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.tool-module-records .tool-record-list,
.tool-module-records .tool-table-wrap,
.tool-module-records .tool-mobile-inline-editor,
.tool-module-records .tool-empty {
  margin-top: 12px;
}

.tool-module-records .section-title h2,
.tool-module-editor .section-title h2 {
  font-size: 20px;
}

.tool-module-editor .section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.tool-form-actions,
.tool-record-actions,
.tool-table-actions,
.tool-actions-desktop {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-presets {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tool-record-actions {
  align-self: start;
  flex: 0 0 auto;
}

.tool-table-actions {
  justify-content: flex-end;
  white-space: nowrap;
}

.tool-card-more {
  position: relative;
  flex: 0 0 auto;
  display: none;
}

.tool-card-more summary {
  list-style: none;
}

.tool-card-more summary::-webkit-details-marker {
  display: none;
}

.tool-card-more-trigger {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-color: #e8e0d0;
  background: #fbf8f3;
  color: #8a857a;
}

.tool-card-more[open] .tool-card-more-trigger {
  border-color: #ddd4c2;
  background: #f5efe4;
  color: #7a6746;
}

.tool-card-more-trigger svg {
  width: 14px;
  height: 14px;
}

.tool-card-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  display: grid;
  min-width: 92px;
  padding: 6px;
  border: 1px solid rgba(223, 226, 221, 0.95);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.12);
}

.tool-card-menu-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 10px;
  border-radius: 8px;
}

.tool-card-menu-btn.danger {
  color: #9a5a4b;
}

.tool-card-menu-btn:active {
  background: #f6f1e8;
}

.tool-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.tool-field:has(.tool-custom-select.is-open),
.tool-inline-field:has(.tool-custom-select.is-open) {
  position: relative;
  z-index: 26;
}

.tool-field-wide {
  grid-column: 1 / -1;
}

.tool-managed-select {
  display: block;
  min-width: 0;
}

.tool-managed-select .tool-custom-select {
  width: 100%;
}

.tool-custom-select {
  position: relative;
  min-width: 0;
}

.tool-custom-select.is-disabled {
  opacity: 0.56;
}

.tool-custom-select.is-open {
  z-index: 26;
}

.tool-custom-select-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  min-height: 40px;
  border: 1px solid #d9ddd7;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  box-sizing: border-box;
  padding: 0 12px;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.tool-custom-select-trigger.is-placeholder {
  color: #7f8b82;
}

.tool-custom-select-trigger:focus,
.tool-custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 93, 74, 0.08);
}

.tool-custom-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-custom-select-caret {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #8a857a;
  transform: rotate(-90deg);
  transition: transform 0.16s ease;
}

.tool-custom-select.is-open .tool-custom-select-caret {
  transform: rotate(0deg);
}

.tool-custom-select-caret svg {
  width: 14px;
  height: 14px;
}

.tool-custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(223, 226, 221, 0.95);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 16px 34px rgba(23, 33, 29, 0.12);
}

.tool-custom-select.menu-upward .tool-custom-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.tool-custom-select-option {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.tool-custom-select-option:active {
  background: #f6f1e8;
}

.tool-custom-select-option.active {
  background: var(--select);
  color: var(--ink);
}

.tool-custom-select-option-clear {
  color: #7f8b82;
}

.tool-managed-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.tool-managed-select-row > .tool-custom-select {
  min-width: 0;
}

.tool-managed-create-btn,
.tool-managed-control-btn {
  min-height: 32px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.tool-managed-control-btn {
  display: inline-grid;
  place-items: center;
  align-self: start;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  aspect-ratio: 1 / 1;
  flex: 0 0 28px;
  margin-top: 8px;
}

.tool-managed-control-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tool-managed-dialog {
  display: grid;
  gap: 12px;
}

.tool-managed-editor-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.tool-managed-editor-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(223, 226, 221, 0.95);
  border-radius: 12px;
  background: #faf9f5;
}

.tool-managed-editor-section {
  display: grid;
  gap: 8px;
}

.tool-managed-editor-section + .tool-managed-editor-section {
  margin-top: 14px;
}

.tool-managed-editor-section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tool-managed-editor-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #e4dccd;
  border-radius: 10px;
  background: #ffffff;
}

.tool-managed-editor-item.active {
  border-color: var(--select-line);
  background: var(--select);
}

.tool-managed-editor-item-readonly {
  background: #faf8f2;
}

.tool-managed-editor-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.tool-managed-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.tool-managed-editor-badge {
  align-self: center;
  border-radius: 999px;
  background: #ece7dc;
  color: #766f63;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
}

.tool-managed-row-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: 1px solid #e4dccd;
  border-radius: 999px;
  background: #fffdf8;
  color: #8a7041;
  padding: 0;
}

.tool-managed-row-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.tool-managed-inline-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid #d8d0c2;
  border-radius: 10px;
  background: #ffffff;
  padding: 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.tool-managed-editor-item-editing {
  padding: 8px 10px;
}

.tool-managed-row-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tool-managed-row-btn.danger {
  color: #a06254;
}

.tool-managed-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.system-dialog-card.system-dialog-managed-options {
  width: min(560px, calc(100vw - 32px));
}

.system-dialog-managed-options .system-dialog-message {
  white-space: normal;
}

.system-dialog-card.system-dialog-user-editor {
  width: min(560px, calc(100vw - 32px));
}

.admin-user-edit-dialog {
  display: grid;
  gap: 12px;
}

.admin-user-edit-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(223, 226, 221, 0.95);
  border-radius: 12px;
  background: #faf9f5;
}

.admin-user-edit-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.admin-user-edit-field {
  display: grid;
  gap: 4px;
  margin: 12px 0 8px;
  color: var(--muted);
}

.admin-user-edit-field span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.admin-user-edit-field small {
  font-size: 12px;
  font-weight: 700;
}

.admin-user-danger-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d9ddd7;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}

.admin-user-danger-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 93, 74, 0.12);
}

.admin-user-password-wrap {
  position: relative;
}

.admin-user-password-wrap #systemDialogInput {
  padding-right: 48px;
}

.admin-user-password-wrap.is-hidden #systemDialogInput {
  -webkit-text-security: disc;
}

.admin-user-password-wrap.is-visible #systemDialogInput {
  -webkit-text-security: none;
}

.admin-user-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #7f887f;
  cursor: pointer;
  transform: translateY(-50%);
}

.admin-user-password-toggle:hover {
  color: var(--ink);
}

.admin-user-password-toggle:focus-visible {
  outline: 2px solid rgba(31, 93, 74, 0.24);
  outline-offset: 2px;
  border-radius: 8px;
}

.admin-user-password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.system-dialog-user-editor #systemDialogInput,
.system-dialog-user-editor #systemDialogTextarea {
  margin-top: 0;
}

.system-dialog-user-editor #systemDialogCheckboxRow {
  margin-top: 10px;
}

.admin-user-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user-edit-actions-bottom {
  margin-top: 14px;
  padding-top: 2px;
}

.tool-record-list {
  display: grid;
  gap: 10px;
}

.tool-table-wrap {
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-radius: 0 0 8px 8px;
  background: white;
  padding: 0 0 14px;
  -webkit-overflow-scrolling: touch;
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.tool-table th,
.tool-table td {
  border-bottom: 1px solid rgba(227, 226, 219, 0.7);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

.tool-table th {
  background: #fbfbf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tool-table td {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.tool-text-ellipsis {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tool-table td:last-child {
  width: 76px;
  text-align: right;
  white-space: nowrap;
}

.tool-table th:last-child {
  width: 76px;
  text-align: right;
}

.tool-table tbody tr:last-child td {
  border-bottom: 0;
}

.tool-table tr.is-done td {
  background: #f6f7f4;
  color: var(--muted);
}

.tool-table tr.is-done strong {
  text-decoration: line-through;
}

.tool-empty-row td {
  color: var(--muted);
  padding: 0;
}

.tool-empty-row span {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  text-align: center;
}

.tool-inline-row td {
  background: white;
  vertical-align: top;
  overflow: visible;
}

.tool-mobile-inline-editor {
  display: none;
}

.tool-inline-action-cell {
  width: 156px;
  min-width: 156px;
  vertical-align: top;
}

.tool-inline-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.tool-inline-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tool-inline-row .tool-inline-field > span {
  display: none;
}

.tool-inline-row .tool-custom-select-menu {
  margin-top: 0;
}

.tool-inline-field input,
.tool-inline-field select,
.tool-inline-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  line-height: 1.2;
  vertical-align: top;
}

.tool-inline-field input[type="date"] {
  padding-right: 8px;
  min-width: 0;
}

.tool-inline-field textarea {
  min-height: 88px;
  padding-top: 9px;
  padding-bottom: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: hidden;
  resize: none;
}

.tool-inline-wide {
  grid-column: span 2;
}

.tool-inline-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 148px;
  flex-wrap: nowrap;
}

.tool-inline-actions .primary-btn,
.tool-inline-actions .ghost-btn {
  width: auto;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
}

.tool-table .text-btn {
  min-height: 28px;
  padding: 0 6px;
}

.family-tree-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: clamp(300px, 42vh, 440px);
  padding: 20px 18px 18px;
  overflow: hidden;
}

.family-tree-panel .section-title {
  align-items: start;
}

.family-tree-panel .section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.family-tree-graph {
  position: relative;
  display: grid;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 10px 6px;
}

.family-tree-spine {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: calc(92px + 50%);
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(207, 222, 213, 0.35) 4%, var(--sage-line) 10%, var(--sage-line) 90%, rgba(207, 222, 213, 0.35) 96%, transparent);
  transform: translateX(-1px);
  pointer-events: none;
}

.family-tier {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(620px, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 74px;
}

.family-tier-label {
  position: sticky;
  left: 0;
  z-index: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  background: var(--panel);
}

.family-tier-body {
  position: relative;
  min-width: 0;
}

.family-branch {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 620px;
  padding: 6px 18px;
}

.family-branch-line {
  position: absolute;
  top: 22px;
  left: 50%;
  width: min(84%, 760px);
  height: 1px;
  background: var(--sage-line);
  transform: translateX(-50%);
}

.family-branch-line::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 2px solid #b7c4bb;
  border-radius: 999px;
  background: #ffffff;
  content: "";
  transform: translate(-50%, -50%);
}

.family-node-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 900px;
}

.family-root {
  display: grid;
  justify-items: center;
  min-width: 620px;
  padding: 2px 18px;
}

.family-root-node {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: #ffffff;
  color: var(--green-dark);
  box-shadow: 0 10px 22px rgba(31, 93, 74, 0.08);
}

.family-root-node strong {
  font-size: 26px;
  line-height: 1;
}

.family-root-node span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}

.family-node {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 160px;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 8px 10px 8px 8px;
  text-align: left;
  box-shadow: 0 6px 14px rgba(23, 33, 29, 0.05);
}

.family-node-male {
  border-color: #b7d8f2;
  background: #f2f8fd;
}

.family-node-male .family-node-mark {
  background: #dceefb;
  color: #256184;
}

.family-node-female {
  border-color: #f2c3d5;
  background: #fff4f8;
}

.family-node-female .family-node-mark {
  background: #fde2eb;
  color: #9b4164;
}

.family-node-deceased {
  border-color: #d8d8d2;
  background: #f2f3ef;
  color: var(--muted);
}

.family-node-deceased .family-node-mark {
  background: #dedfd9;
  color: #6f746c;
}

.family-row,
.family-self-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 2px 20px;
}

.family-row::before,
.family-self-wrap::before,
.family-couple-row::before,
.family-children-row::before,
.family-node::before,
.family-self-linked-target::after {
  display: none;
}

.family-unit {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 620px;
  padding: 2px 20px 8px;
}

.family-couple-row,
.family-children-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.family-couple-row::before,
.family-children-row::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(260px, 78%);
  height: 1px;
  background: var(--sage-line);
  content: "";
  transform: translate(-50%, -50%);
}

.family-children-row::before {
  top: -10px;
  width: min(420px, 86%);
}

.family-couple-line {
  width: min(240px, 62%);
  height: 1px;
  background: var(--sage-line);
}

.family-child-stem {
  width: 1px;
  height: 14px;
  margin-top: -12px;
  margin-bottom: -12px;
  background: var(--sage-line);
}

.family-unit .family-node {
  z-index: 1;
}

.family-unit-parents {
  margin-bottom: -4px;
}

.family-unit-parents-single {
  padding-bottom: 0;
}

.family-unit-parents-single .family-child-stem {
  height: 22px;
  margin-bottom: -18px;
}

.family-unit-self {
  margin-top: 2px;
}

.family-self-family {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 620px;
}

.family-self-linked-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 620px;
  padding: 2px 20px;
}

.family-self-linked-target,
.family-self-linked-side {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.family-self-linked-side {
  justify-content: flex-start;
}

.family-self-linked-target::after {
  position: absolute;
  top: 50%;
  left: 100%;
  width: 12px;
  height: 1px;
  background: var(--sage-line);
  content: "";
}

.family-self-family > .family-couple-line {
  width: min(240px, 62%);
}

.family-self-family > .family-children-row::before {
  top: -10px;
}

.family-node strong,
.family-node span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-node strong {
  color: var(--ink);
  font-size: 14px;
}

.family-node span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.family-node-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.family-node-copy strong,
.family-node-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-node-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.family-node-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f3f4f1;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.family-node-self {
  z-index: 2;
  min-width: 170px;
  border: 2px solid var(--green);
  box-shadow: 0 10px 22px rgba(31, 93, 74, 0.08);
}

.family-node-self::before {
  display: none;
}

.family-person-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f3f4f1;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.family-person-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.family-node-grand {
  border-color: #d9d4c4;
}

.family-node-parent {
  border-color: var(--sage-line);
}

.family-node-peer {
  border-color: #d7d2f4;
}

.family-node-child {
  border-color: #ffd0dc;
}

.family-node-other {
  background: #fbfbf8;
}

.family-node-empty {
  border-style: dashed;
  background: #fbfbf8;
  color: var(--muted);
  opacity: 0.72;
}

.family-tree-canvas {
  position: relative;
  display: block;
  min-height: 0;
  overflow: auto;
  padding: 0;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.family-map {
  position: relative;
  min-width: 100%;
}

.family-map-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.family-map-lines line {
  stroke: var(--sage-line);
  stroke-width: 2;
  stroke-linecap: round;
}

.family-map-node {
  position: absolute;
  z-index: 1;
}

.family-map-node .family-node {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
}

.family-trunk {
  display: none;
}

.family-generation {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 72px;
}

.family-generation-stage {
  position: relative;
  min-width: 0;
}

.family-rail {
  display: none;
}

.family-rail::before {
  display: none;
}

.family-people {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 2px 20px;
}

.family-root {
  min-width: 620px;
  padding: 6px 20px;
}

.family-root-node {
  width: 92px;
  height: 92px;
  border-width: 2px;
}

.family-person {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 148px;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 8px 10px 8px 8px;
  box-shadow: 0 6px 12px rgba(23, 33, 29, 0.04);
}

.family-person::before {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: var(--sage-line);
  content: "";
}

.family-generation-child .family-person::before,
.family-generation-other .family-person::before {
  top: auto;
  bottom: -10px;
}

.family-person-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f3f4f1;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.family-person-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.family-person-copy strong,
.family-person-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-person-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.family-person-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.family-person-self {
  width: 112px;
  height: 112px;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px;
  border: 2px solid var(--green);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(31, 93, 74, 0.08);
}

.family-person-self::before {
  display: none;
}

.family-person-self .family-person-mark {
  width: 38px;
  height: 38px;
  font-size: 15px;
}

.family-person-self .family-person-copy {
  justify-items: center;
}

.family-person-grand {
  border-color: #d9d4c4;
}

.family-person-parent {
  border-color: var(--sage-line);
}

.family-person-peer {
  border-color: #d7d2f4;
}

.family-person-child {
  border-color: #ffd0dc;
}

.family-person-other {
  background: #fbfbf8;
}

.family-person-empty {
  border-style: dashed;
  opacity: 0.72;
}

.tool-group {
  display: grid;
  gap: 8px;
}

.tool-group + .tool-group {
  padding-top: 6px;
}

.tool-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tool-group-title small {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f1f2ee;
  color: var(--ink);
}

.tool-record,
.tool-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.tool-empty-rich {
  display: grid;
  gap: 12px;
  align-items: center;
  justify-items: center;
}

.tool-empty-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.tool-empty-actions {
  min-width: 0;
  justify-self: stretch;
}

.tool-empty-actions .tool-presets {
  padding-bottom: 0;
}

.tool-record {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tool-record.is-done {
  background: #f6f7f4;
  color: var(--muted);
}

.tool-record.is-done strong {
  text-decoration: line-through;
}

.tool-record-main {
  display: flex;
  min-width: 0;
  gap: 10px;
}

.tool-record-main > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.tool-record strong,
.tool-record small,
.tool-record p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tool-record small,
.tool-record p,
.tool-empty {
  color: var(--muted);
}

.tool-record p {
  margin: 2px 0 0;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tool-check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--sage-line);
  border-radius: 999px;
  background: var(--sage);
  color: var(--green-dark);
  font-weight: 900;
}

.tool-countdown {
  width: fit-content;
  border-radius: 999px;
  background: var(--sage);
  color: var(--green-dark);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.tool-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.tool-status-neutral {
  background: #f1f2ee;
  color: var(--muted);
}

.tool-status-good {
  background: var(--sage);
  color: var(--green-dark);
}

.tool-status-warn {
  background: #fff2cf;
  color: #7c5b10;
}

.tool-status-bad {
  background: #ffe6e9;
  color: #8a1732;
}

.draw-panel {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 24px;
  border-color: #eadde1;
}

.draw-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 18px 0 14px;
  height: 300px;
  min-height: 300px;
}

.draw-heading,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.option-editor {
  display: grid;
  gap: 12px;
}

.option-list,
.box-list,
.history-list {
  display: grid;
  gap: 10px;
}

.option-list {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.option-pill,
.box-item,
.history-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.option-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px 0 13px;
  border-color: #dde2dd;
  background: #f5f6f2;
  color: #39483f;
  font-weight: 800;
}

.option-pill span,
.box-item span,
.history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-btn,
.text-btn {
  border: 0;
  background: transparent;
  color: #8a7360;
  font-weight: 900;
}

.remove-btn:hover,
.text-btn:hover {
  color: #5f4a3a;
}

.draw-button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: min(260px, 82vw);
  min-height: 210px;
  margin: 6px auto 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
}

.box-lid,
.box-body {
  display: block;
  border-radius: 8px;
  transition: transform 0.35s ease;
}

.box-lid {
  width: 210px;
  height: 44px;
  background: #efe3c7;
  transform: rotate(-5deg);
  box-shadow: 0 6px 0 rgba(110, 83, 35, 0.09);
}

.box-body {
  width: 186px;
  height: 116px;
  background:
    linear-gradient(90deg, transparent 44%, #d7c494 44% 56%, transparent 56%),
    linear-gradient(180deg, #9b8351, #806a40);
  box-shadow: 0 14px 24px rgba(128, 106, 64, 0.2);
}

.draw-button strong {
  position: absolute;
  top: 118px;
  left: 50%;
  z-index: 2;
  margin-top: 0;
  color: #ffffff;
  font-size: 20px;
  text-shadow: 0 2px 8px rgba(23, 33, 29, 0.24);
  transform: translateX(-50%);
}

.draw-button.is-drawing .box-lid {
  transform: translateY(-18px) rotate(8deg);
}

.draw-button.is-drawing .box-body {
  transform: scale(1.04);
}

.result {
  position: absolute;
  top: 248px;
  left: 50%;
  display: grid;
  place-items: center;
  width: min(240px, 64vw);
  min-height: 30px;
  padding: 0 8px;
  border-radius: 0;
  background: transparent;
  color: var(--result);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: none;
}

body.is-miniprogram-entry .topbar {
  display: block;
  height: 0;
  min-height: 0;
  padding: 0;
  overflow: visible;
}

body.is-miniprogram-entry .topbar h1,
body.is-miniprogram-entry .topbar-actions > .admin-menu-btn,
body.is-miniprogram-entry .topbar-actions > .avatar-btn {
  display: none;
}

body.is-miniprogram-entry .quick-create {
  margin-bottom: 10px;
  padding-bottom: 12px;
}

body.is-miniprogram-entry .rail-brand,
body.is-miniprogram-entry .mobile-top-logo {
  display: none !important;
}

body.is-miniprogram-entry .draw-layout {
  gap: 10px;
}

body.is-miniprogram-entry .draw-panel {
  gap: 14px;
  padding: 16px;
}

body.is-miniprogram-entry .draw-stage {
  height: 218px;
  min-height: 218px;
}

body.is-miniprogram-entry .draw-button {
  width: min(220px, 68vw);
  min-height: 160px;
  margin-top: 0;
}

body.is-miniprogram-entry .box-lid {
  width: min(178px, 56vw);
  height: 36px;
}

body.is-miniprogram-entry .box-body {
  width: min(158px, 50vw);
  height: 92px;
}

body.is-miniprogram-entry .draw-button strong {
  top: 88px;
  margin-top: 0;
  font-size: 18px;
}

body.is-miniprogram-entry .result {
  top: 184px;
  width: min(210px, 62vw);
  min-height: 28px;
  font-size: 18px;
}

.side-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.side-column .panel:only-child,
.side-column .panel:not(.hidden) {
  min-height: 0;
}

.side-column .panel {
  padding: 18px;
}

.history-panel-inline {
  padding: 18px;
}

.history-panel-inline .history-list {
  margin-top: 10px;
}

.box-item {
  display: grid;
  gap: 3px;
  padding: 12px;
  background: #ffffff;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.box-item.active {
  background: var(--select);
  border-color: var(--select-line);
  box-shadow: none;
}

.box-item small,
.history-item small,
.fineprint {
  color: var(--muted);
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px;
  background: #fbf9ff;
  padding: 11px 12px;
}

.history-item small {
  grid-column: 1;
}

.history-delete {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 33, 29, 0.38);
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(23, 33, 29, 0.12);
  padding: 28px;
}

.native-pay-card {
  width: min(420px, 100%);
  text-align: center;
}

.native-pay-qr {
  display: grid;
  place-items: center;
  width: 244px;
  height: 244px;
  margin: 8px auto 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.native-pay-qr canvas {
  width: 220px;
  height: 220px;
}

.native-pay-fallback {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 999px;
  background: #8f6df6;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.close-btn:hover {
  background: #7d5ff0;
}

.price-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 18px 0;
}

.member-expiry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  padding: 12px 14px;
  margin-top: 16px;
}

.member-retention-expiry {
  margin-top: 10px;
}

.member-expiry span,
.invite-code-box span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.member-expiry strong {
  color: var(--green-dark);
}

.member-expiry strong.member-retention-cleaning {
  color: #c2410c;
}

.price-row strong {
  font-size: 42px;
}

.price-row del {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.benefits,
.member-benefit-list {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.benefits p,
.member-benefit-list li {
  margin: 0;
}

.member-renewal-tips {
  display: grid;
  gap: 8px;
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.member-renewal-tips p {
  margin: 0;
}

.invite-benefit {
  display: grid;
  gap: 6px;
  border: 1px solid var(--sage-line);
  border-radius: 8px;
  background: var(--sage);
  color: var(--green-dark);
  padding: 12px;
  margin-top: 14px;
}

.invite-benefit strong {
  color: var(--ink);
}

.invite-benefit span {
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.invite-member-card {
  gap: 16px;
}

.invite-code-box {
  border: 1px solid var(--warm-line);
  border-radius: 8px;
  background: var(--warm);
  padding: 10px 12px;
}

.invite-code-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.invite-code-box strong {
  color: var(--ink);
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-copy-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--warm-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--green-dark);
}

.invite-copy-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invite-copy-btn:hover {
  border-color: var(--sage-line);
  background: var(--sage);
}

.invite-member-actions {
  display: grid;
  gap: 10px;
}

.invite-member-actions .primary-btn,
.invite-member-actions .secondary-btn {
  width: 100%;
}

.invite-share-tip {
  margin: 2px 0 0;
}

.settings-card {
  max-height: min(720px, 86vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.settings-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-color: #c8cbc7 transparent;
  scrollbar-width: thin;
}

.settings-empty {
  margin: 0;
  padding: 16px 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.settings-group-title {
  margin: 8px 2px 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.settings-group-title:first-child {
  margin-top: 0;
}

.tool-category-admin {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.tool-category-admin-panel {
  overflow: visible;
}

.tool-category-section {
  display: grid;
  gap: 10px;
  border: 1px solid #ece6d8;
  border-radius: 16px;
  background: #fcfbf7;
  padding: 12px;
}

.tool-category-section-copy {
  min-width: 0;
}

.tool-category-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.tool-category-section-head input {
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  padding: 0;
}

.tool-category-menu-list {
  display: grid;
  gap: 6px;
}

.tool-category-menu-item {
  display: grid;
  grid-template-columns: 24px 42px minmax(120px, 1fr) minmax(140px, 0.65fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 10px 12px;
}

.tool-category-settings-item {
  align-items: center;
  gap: 10px;
}

.tool-category-settings-item:has(.tool-custom-select.is-open) {
  position: relative;
  z-index: 28;
}

.settings-main.tool-category-settings-main {
  display: grid;
  grid-template-columns: 24px 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
}

.settings-copy.tool-category-item-copy {
  display: block;
  min-width: 0;
}

.tool-category-item-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.tool-category-assignment-field {
  display: grid;
  gap: 0;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.tool-category-settings-side {
  display: grid;
  grid-template-columns: minmax(150px, 210px) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.tool-category-settings-actions {
  justify-self: end;
}

.tool-category-settings-side .tool-custom-select-trigger {
  min-height: 36px;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
}

.tool-category-settings-side .tool-custom-select-caret {
  width: 16px;
  height: 16px;
}

.tool-category-settings-actions .settings-action-circle {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.tool-category-visible-checkbox {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #8f6df6;
}

.tool-category-empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 800;
  padding: 18px;
  text-align: center;
}

.tool-category-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.settings-list::-webkit-scrollbar {
  width: 5px;
}

.settings-list::-webkit-scrollbar-track {
  background: transparent;
}

.settings-list::-webkit-scrollbar-thumb {
  background: #c8cbc7;
  border-radius: 999px;
}

.settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.settings-item.selected {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.settings-item.archived {
  background: transparent;
}

.settings-item.archived .settings-copy strong {
  color: #8b9298;
}

.settings-main {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border: 1px solid #e7e1d3;
  border-radius: 12px;
  background: #ffffff;
  padding: 8px 10px;
}

.settings-item.selected .settings-main {
  border-color: #8a7041;
  background: #f7f1e3;
}

.settings-item.archived .settings-main {
  background: #f5f1e8;
}

.settings-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--menu-icon-bg);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    var(--menu-icon-shadow);
}

.settings-index svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}

.settings-index.tone-rose,
.settings-index.tone-mint,
.settings-index.tone-plum,
.settings-index.tone-sky,
.settings-index.tone-gold {
  background: var(--menu-icon-bg);
}

.settings-item.selected .settings-index {
  background: var(--menu-icon-bg-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(23, 33, 29, 0.12);
}

.settings-item:not(.selected) .settings-index {
  opacity: 0.88;
}

.settings-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.settings-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.settings-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.settings-actions {
  display: flex;
  gap: 7px;
  justify-content: end;
  align-items: center;
}

.settings-action-circle,
.settings-action-check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #dccfb6;
  border-radius: 999px;
  background: #fffdf8;
  color: #7b6540;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.settings-action-circle.secondary {
  border-color: #d5c4a0;
  background: #f5ecd9;
}

.settings-action-circle:hover:not(:disabled),
.settings-action-check:hover:not(:disabled) {
  border-color: #8a7041;
  background: #f7f1e3;
}

.settings-action-circle:disabled,
.settings-action-circle.disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.settings-action-check.selected {
  border-color: #8a7041;
  background: #8a7041;
  color: #ffffff;
}

.miniprogram-home-page {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 16% 10%, rgba(215, 196, 148, 0.18), transparent 28%),
    linear-gradient(180deg, #f9f5ee 0%, #f6f7f2 28%, #f5f8f4 100%);
  -webkit-overflow-scrolling: touch;
}

.mini-home-shell {
  min-height: 100vh;
  padding: 10px 12px calc(18px + env(safe-area-inset-bottom));
}

.mini-home-shell-loading {
  display: grid;
  gap: 14px;
}

.mini-home-skeleton-hero,
.mini-home-skeleton-section,
.mini-home-skeleton-card {
  position: relative;
  overflow: hidden;
}

.mini-home-skeleton-hero::after,
.mini-home-skeleton-section::after,
.mini-home-skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%);
  transform: translateX(-100%);
  animation: mini-home-skeleton-wave 1.25s ease-in-out infinite;
  pointer-events: none;
}

.mini-home-skeleton-hero {
  display: grid;
  gap: 10px;
  padding: 18px 16px;
  border: 1px solid rgba(222, 208, 173, 0.7);
  border-radius: 18px;
  background: rgba(255, 251, 244, 0.86);
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.05);
}

.mini-home-skeleton-pill,
.mini-home-skeleton-title,
.mini-home-skeleton-copy,
.mini-home-skeleton-section-title,
.mini-home-skeleton-icon,
.mini-home-skeleton-label {
  display: block;
  border-radius: 999px;
  background: rgba(176, 143, 87, 0.16);
}

.mini-home-skeleton-pill {
  width: 84px;
  height: 12px;
}

.mini-home-skeleton-title {
  width: 46%;
  min-width: 128px;
  height: 24px;
  border-radius: 12px;
}

.mini-home-skeleton-copy {
  width: 72%;
  min-width: 180px;
  height: 14px;
}

.mini-home-skeleton-section {
  display: grid;
  gap: 10px;
}

.mini-home-skeleton-section-title {
  width: 92px;
  height: 12px;
  margin-left: 4px;
}

.mini-home-skeleton-section-title.short {
  width: 72px;
}

.mini-home-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mini-home-skeleton-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-home-skeleton-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 104px;
  padding: 16px 10px 14px;
  border: 1px solid rgba(231, 225, 211, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(23, 33, 29, 0.05);
}

.mini-home-skeleton-card-compact {
  min-height: 88px;
}

.mini-home-skeleton-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.mini-home-skeleton-label {
  width: 72%;
  min-width: 48px;
  height: 12px;
}

@keyframes mini-home-skeleton-wave {
  100% {
    transform: translateX(100%);
  }
}

.mini-home-shell button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font-family: inherit;
  line-height: 1;
}

.mini-home-safe {
  min-height: 0;
  padding: 0 120px 5px 3px;
}

.mini-home-tagline {
  margin: 0;
  color: #7f8b82;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

body.is-miniprogram-home .tool-rail,
body.is-miniprogram-home .topbar,
body.is-miniprogram-home .mobile-bottom-nav {
  display: none !important;
}

body.is-miniprogram-home .workspace {
  display: block;
  height: 100vh;
  overflow: hidden;
}

body.is-miniprogram-home .main-scroll {
  height: 0;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
}

body.is-miniprogram-home .miniprogram-home-page {
  display: block;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}

body.is-mobile-home .tool-rail,
body.is-mobile-home .topbar {
  display: none !important;
}

body.is-mobile-home .workspace {
  display: block;
  height: 100vh;
  overflow: hidden;
}

body.is-mobile-home .main-scroll {
  height: 0;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
}

body.is-mobile-home .miniprogram-home-page {
  display: block;
  width: 100%;
  height: calc(100vh - 72px - env(safe-area-inset-bottom));
  min-height: calc(100vh - 72px - env(safe-area-inset-bottom));
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.mini-home-section {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
}

.mini-home-section h2 {
  position: relative;
  margin: 0;
  padding-left: 10px;
  color: #7c6744;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.03em;
}

.mini-home-section h2::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: #c8ae7b;
  content: "";
  transform: translateY(-50%);
}

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

.mini-home-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 59px;
  border: 1px solid #dce8df;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 14px rgba(23, 33, 29, 0.04);
  padding: 9px;
  color: var(--ink);
  text-align: left;
}

.mini-home-card:active {
  border-color: #c8ae7b;
  background: #fffaf0;
  transform: scale(0.99);
}

.mini-home-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--menu-icon-bg);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    var(--menu-icon-shadow);
}

.mini-home-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.mini-home-icon.tone-rose,
.mini-home-icon.tone-mint,
.mini-home-icon.tone-plum,
.mini-home-icon.tone-sky,
.mini-home-icon.tone-gold {
  background: var(--menu-icon-bg);
}

.mini-home-card:active .mini-home-icon {
  background: var(--menu-icon-bg-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(23, 33, 29, 0.12);
}

.mini-home-card strong {
  overflow: hidden;
  color: #17211d;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-home-footer {
  padding: 8px 0 calc(12px + env(safe-area-inset-bottom));
}

.mini-home-archived-panel {
  margin-bottom: 9px;
  border: 1px solid #e4dccd;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(23, 33, 29, 0.04);
  overflow: hidden;
}

.mini-home-archived-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 11px 12px;
  color: #6c5a39;
  text-align: left;
}

.mini-home-archived-head span {
  display: grid;
  gap: 4px;
}

.mini-home-archived-head strong {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.mini-home-archived-head small {
  color: #8d8475;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}

.mini-home-archived-head em {
  color: #8a7041;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
}

.mini-home-archived-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 12px 12px;
}

.mini-home-archived-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 48px;
  border: 1px dashed #d9cdb5;
  border-radius: 9px;
  background: #f9f5ec;
  padding: 8px;
  color: var(--ink);
  text-align: left;
}

.mini-home-archived-card strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-home-archived-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 6px 4px;
  color: #958a77;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.mini-home-editor-open {
  width: 100%;
  min-height: 42px;
  border: 1px solid #decda8;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(138, 112, 65, 0.08);
  color: #8a7041;
  font-size: 14px;
  font-weight: 700;
}

.mini-home-hint-block {
  margin-top: 12px;
}

.mini-home-hint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.mini-home-hint-row span {
  flex: 1 1 0;
  height: 1px;
  background: rgba(138, 112, 65, 0.22);
}

.mini-home-hint-row strong {
  flex: 0 0 auto;
  color: #8c8577;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}

.mini-home-version-text {
  margin: 6px 0 0;
  color: rgba(140, 133, 119, 0.7);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.mini-home-editor-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(23, 33, 29, 0.26);
}

.mini-home-editor-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-height: 82vh;
  border-radius: 18px 18px 0 0;
  background: #fbfaf7;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}

.mini-home-editor-head,
.mini-home-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-home-editor-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.mini-home-text-btn {
  border: 0;
  background: transparent;
  color: #8a7041;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.mini-home-editor-scroll {
  min-height: 0;
  margin-top: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.mini-home-editor-group + .mini-home-editor-group {
  margin-top: 14px;
}

.mini-home-editor-group h3 {
  margin: 0 0 10px;
  color: #8a7041;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.mini-home-editor-options {
  display: grid;
  gap: 8px;
}

.mini-home-editor-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.mini-home-editor-main {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid #e7e1d3;
  border-radius: 12px;
  background: #ffffff;
  padding: 7px 8px;
}

.mini-home-editor-option.selected .mini-home-editor-main {
  border-color: #8a7041;
  background: #f7f1e3;
}

.mini-home-editor-option.archived .mini-home-editor-main {
  background: #f5f1e8;
}

.mini-home-editor-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-home-editor-actions {
  display: grid;
  grid-template-columns: repeat(4, 30px);
  gap: 6px;
}

.mini-home-editor-circle,
.mini-home-editor-check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #dccfb6;
  border-radius: 999px;
  background: #fffdf8;
  color: #7b6540;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.mini-home-editor-circle.secondary {
  border-color: #d5c4a0;
  background: #f5ecd9;
}

.mini-home-editor-circle.disabled {
  opacity: 0.36;
  pointer-events: none;
}

.mini-home-editor-check.selected {
  border-color: #8a7041;
  background: #8a7041;
  color: #ffffff;
}

.mini-home-editor-footer {
  margin-top: 10px;
}

.mini-home-editor-btn {
  flex: 1 1 0;
  min-height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.mini-home-editor-btn.primary {
  border: 0;
  background: #8a7041;
  color: #ffffff;
  box-shadow: 0 18px 34px rgba(138, 112, 65, 0.2);
}

.mini-home-editor-btn.ghost {
  border: 1px solid #decda8;
  background: rgba(255, 255, 255, 0.74);
  color: #6a5735;
}

.tone-rose { background: var(--tool-tone-rose); }
.tone-mint { background: var(--tool-tone-mint); }
.tone-plum { background: var(--tool-tone-plum); }
.tone-sky { background: var(--tool-tone-sky); }
.tone-gold { background: var(--tool-tone-gold); }

@media (max-width: 860px) {
  .app-shell {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    padding: 0;
  }

  .setup-steps {
    display: grid;
  }

  .setup-db-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draw-layout {
    grid-template-columns: 1fr;
  }

  .tool-content-grid,
  .tool-dashboard,
  .tool-form-grid,
  .admin-action-list {
    grid-template-columns: 1fr;
  }

  .admin-page-grid {
    grid-template-columns: 1fr;
  }

  .admin-page-grid-two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-page-grid-three-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-panel {
    min-height: 100svh;
    margin: 0;
    padding: 0;
  }

  .setup-panel {
    padding: 24px;
    margin-top: 3vh;
  }

}

@media (max-width: 520px) {
  .app-shell {
    padding: 0;
  }

  .setup-panel {
    padding: 20px;
  }

  .setup-db-details {
    grid-template-columns: 1fr;
  }

  .tool-rail {
    position: fixed;
    right: auto;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 30;
    display: block;
    width: clamp(220px, 52vw, 300px);
    max-width: calc(100vw - 20px);
    height: auto;
    max-height: min(74vh, 560px);
    margin: 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(23, 33, 29, 0.18);
    overflow: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .tool-rail-toggle {
    display: none;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    height: 100vh;
    margin: 0;
    overflow: hidden;
  }

  .tool-nav {
    display: grid;
    gap: 8px;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .tool-nav-group {
    gap: 2px;
    padding: 6px;
    border-color: rgba(150, 166, 157, 0.16);
    border-radius: 14px;
    background: #f7fbf8;
  }

  .tool-rail.is-expanded {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .tool-nav-item {
    width: 100%;
    min-height: 44px;
    flex: initial;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
    padding: 18px 2px 20px;
  }

  .mobile-top-logo {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -12px 30px rgba(23, 33, 29, 0.12);
    backdrop-filter: blur(12px);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .mobile-bottom-nav.has-admin {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-bottom-nav.menu-hidden {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-bottom-nav.menu-hidden.has-admin {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-nav-btn {
    min-height: 54px;
    border-radius: 12px;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-nav-btn.active,
  .mobile-nav-btn:active,
  .mobile-nav-btn:focus,
  .mobile-nav-btn:focus-visible {
    background: transparent;
    color: var(--ink);
  }

  .topbar-actions {
    display: contents;
  }

  .topbar-actions > .admin-menu-btn,
  .topbar-actions > .avatar-btn {
    display: none;
  }

  .admin-menu,
  .user-menu {
    position: fixed;
    top: auto;
    right: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 60;
    min-width: 168px;
  }

  .main-scroll {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 8px calc(86px + env(safe-area-inset-bottom));
  }

  body.mobile-input-active .mobile-bottom-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + env(safe-area-inset-bottom)));
  }

  body.mobile-input-active .main-scroll {
    padding-bottom: 16px;
  }

  .tool-page {
    gap: 12px;
  }

  .tool-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tool-summary-card {
    padding: 14px 14px 13px;
  }

  .tool-summary-card strong {
    font-size: clamp(20px, 6vw, 28px);
  }

  .time-fragment-panel {
    min-height: 0;
  }

  .time-fragment-head {
    justify-content: center;
  }

  .time-fragment-head > .time-fragment-scopes {
    margin-left: 0;
  }

  .time-fragment-chart-scroll {
    padding: 8px;
  }

  .time-fragment-chart,
  .time-fragment-chart > .tool-chart-empty,
  .time-fragment-vchart {
    min-height: 220px;
  }

  .period-summary-grid > :nth-child(n + 3) {
    display: block;
  }

  .tool-module-records .section-title {
    padding-right: 0;
    padding-left: 0;
  }

  body.is-miniprogram-entry .topbar {
    display: block;
    height: 0;
    min-height: 0;
    padding: 0;
    overflow: visible;
  }

  body.is-miniprogram-entry .main-scroll {
    padding-right: 4px;
    padding-left: 4px;
  }

  body.is-miniprogram-entry .tool-page {
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.is-miniprogram-entry .topbar h1 {
    display: none;
  }

  .tool-trend {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-right: 12px;
    padding-left: 12px;
    overflow: hidden;
  }

  .tool-chart-stack,
  .tool-vchart-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tool-vchart-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .tool-vchart:has(.tool-chart-empty),
  .tool-vchart:has(.tool-chart-loading) {
    width: 100%;
    min-width: 0 !important;
  }

  .tool-trend-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .tool-trend-head-left {
    width: 100%;
    flex: 1 1 100%;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    overflow: visible;
  }

  .life-timeline-panel {
    gap: 12px;
    padding: 12px;
    min-height: 286px;
  }

  .life-timeline-head {
    justify-content: center;
  }

  .life-timeline-tools {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-right: 0;
  }

  .life-timeline-filters {
    justify-content: center;
    width: 100%;
  }

  .life-timeline {
    min-height: 220px;
    padding: 72px 4px 28px;
  }

  .life-timeline::before {
    display: none;
  }

  .life-timeline-item {
    grid-template-rows: 32px 18px auto;
    flex-basis: 150px;
    min-width: 150px;
    padding: 0 8px;
  }

  .life-timeline-marker {
    width: 14px;
    height: 14px;
  }

  .life-timeline-date {
    font-size: 12px;
  }

  .tool-trend-dimensions {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .tool-trend-dimensions button {
    flex: 0 0 auto;
    min-width: 42px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .time-fragment-scopes button {
    min-width: 54px;
    padding: 0 9px;
  }

  .tool-trend-types {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-width: 0;
  }

  .tool-trend-type-trigger {
    min-width: 50px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .tool-trend-series {
    display: flex !important;
    width: 100%;
    flex: 1 1 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
  }

  .tool-trend-series button {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .tool-trend-series-select {
    display: none;
    margin: 0;
    border: 1px solid #e6dcc9;
    border-radius: 999px;
    background: #fbf8f2;
    overflow: hidden;
  }

  .tool-trend-series-select select {
    width: auto;
    height: 28px;
    min-width: 62px;
    max-width: 90px;
    min-height: 28px;
    padding: 0 22px 0 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    line-height: 28px;
    text-align: center;
    text-align-last: center;
  }

  .tool-trend-series-select select:disabled {
    opacity: 1;
    color: var(--ink);
  }

  .tool-trend-scope select {
    height: 28px;
    min-width: 104px;
    font-size: 11px;
  }

  .tool-trend-stats {
    gap: 20px;
    padding-right: 0;
    padding-left: 0;
  }

  .tool-trend-stat strong {
    font-size: clamp(22px, 7vw, 30px);
  }

  body.is-miniprogram-entry .rail-brand,
  body.is-miniprogram-entry .mobile-top-logo {
    display: none !important;
  }

  body.is-miniprogram-entry .draw-panel {
    gap: 12px;
    padding: 14px;
  }

  .rail-brand {
    display: none;
  }

  .auth-actions,
  .input-row,
  .pay-grid {
    flex-direction: column;
  }

  .auth-brand {
    top: 22px;
    left: 22px;
  }

  .auth-brand img {
    width: 58px;
  }

  .auth-language-lines {
    top: 32%;
    width: calc(100% - 32px);
    gap: 5px;
    font-size: clamp(12px, 3.4vw, 15px);
    line-height: 1.08;
  }

  .auth-language-lines p {
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .auth-actions {
    bottom: 72px;
    width: min(520px, calc(100vw - 56px));
    gap: 14px;
  }

  .auth-actions .primary-btn {
    min-height: 50px;
  }

  .auth-secondary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 10px;
  }

  .auth-agreement-note {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    width: min(100%, 360px);
    margin: 0 auto;
    flex: initial;
    font-size: 14px;
    line-height: 1.45;
  }

  .auth-agreement-note input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    margin-top: 2px;
  }

  .auth-agreement-note input:checked::after {
    width: 9px;
    height: 5px;
  }

  .auth-agreement-note span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .auth-agreement-note button {
    display: inline;
    white-space: nowrap;
  }

  .account-login-link {
    justify-self: center;
    font-size: 14px;
    line-height: 1.3;
  }

  .auth-role-strip {
    bottom: 214px;
    gap: 6px;
  }

  .auth-role-track span {
    padding: 5px 9px;
    font-size: 10px;
  }

  body.is-miniprogram-entry:has(.auth-panel:not(.hidden)) .app-shell {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  body.is-miniprogram-entry .auth-panel {
    min-height: 100vh;
    background: #ffffff;
  }

  body.is-miniprogram-entry .auth-brand {
    top: 25%;
    right: 0;
    left: 0;
  }

  body.is-miniprogram-entry .auth-brand img {
    width: 118px;
    transform: none;
    filter: none;
    border-radius: 28px;
  }

  body.is-miniprogram-entry .auth-language-lines {
    top: 36%;
    gap: 10px;
    font-family: inherit;
  }

  body.is-miniprogram-entry .auth-language-lines p {
    display: none;
    color: var(--ink);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.15;
  }

  body.is-miniprogram-entry .auth-language-lines p:first-child {
    display: block;
  }

  body.is-miniprogram-entry .auth-language-lines p:first-child::before {
    display: block;
    margin-bottom: 12px;
    color: var(--ink);
    content: "Makefar";
  }

  body.is-miniprogram-entry .auth-language-lines p:first-child {
    color: transparent;
  }

  body.is-miniprogram-entry .auth-language-lines p:first-child::after {
    display: block;
    margin-top: 8px;
    color: #8b9298;
    font-size: 14px;
    font-weight: 400;
    content: "登录后同步保存你的记录";
  }

  body.is-miniprogram-entry .auth-actions {
    bottom: calc(132px + env(safe-area-inset-bottom));
    width: calc(100vw - 48px);
    gap: 14px;
  }

  body.is-miniprogram-entry .auth-actions .primary-btn {
    min-height: 48px;
    border-radius: 999px;
    background: #356cf6;
    font-size: 16px;
    font-weight: 500;
    box-shadow: none;
  }

  body.is-miniprogram-entry .auth-secondary-row {
    gap: 28px;
  }

  body.is-miniprogram-entry .miniprogram-skip-login {
    order: 1;
    color: #3166d8;
    font-size: 15px;
  }

  body.is-miniprogram-entry .auth-agreement-note {
    order: 2;
    width: 100%;
    color: #9aa0a6;
    font-size: 12px;
    font-weight: 400;
  }

  body.is-miniprogram-entry .auth-agreement-note button {
    color: #3166d8;
  }

  body.is-miniprogram-entry .auth-role-strip {
    display: none;
  }

  .auth-footer {
    gap: 2px 10px;
    padding: 0 16px 10px;
    font-size: 10px;
    line-height: 1.38;
    white-space: normal;
  }

  .auth-footer span {
    text-align: center;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }

  .quick-create > .primary-btn {
    width: auto;
    min-width: 72px;
  }

  .template-editor-card {
    width: calc(100vw - 28px);
  }

  .template-editor-row {
    grid-template-columns: 1fr;
  }

  .template-editor-actions {
    flex-direction: column;
  }

  .tool-category-section-head,
  .tool-category-menu-item {
    grid-template-columns: 1fr;
  }

  .admin-page-panel,
  .admin-stat-card {
    padding: 14px;
  }

  .system-settings-panel {
    padding: 16px;
  }

  .system-settings-head {
    display: grid;
    gap: 10px;
  }

  .system-choice-grid,
  .system-setting-field-row,
  .virtual-pay-product-row {
    grid-template-columns: 1fr;
  }

  .system-setting-status-grid {
    grid-template-columns: 1fr;
  }

  .system-setting-toggle-grid {
    grid-template-columns: 1fr;
  }

  .system-setting-field {
    max-width: none;
  }

  .system-settings-actions {
    justify-content: flex-start;
  }

  .system-settings-actions .primary-btn {
    width: auto;
  }

  .admin-page-panel .section-title {
    align-items: stretch;
    gap: 10px;
    flex-direction: column;
  }

  .admin-user-table-wrap {
    overflow-x: visible;
  }

  .admin-user-table,
  .admin-user-table thead,
  .admin-user-table tbody,
  .admin-user-table tr,
  .admin-user-table th,
  .admin-user-table td {
    display: block;
  }

  .admin-user-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .admin-user-table thead {
    display: none;
  }

  .admin-user-table tbody {
    display: grid;
    gap: 12px;
  }

  .admin-user-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    padding: 10px 12px;
    box-shadow: 0 8px 20px rgba(23, 33, 29, 0.05);
  }

  .admin-user-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid rgba(223, 226, 221, 0.75);
    padding: 9px 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .admin-user-table td:last-child {
    border-bottom: 0;
  }

  .admin-user-table td::before {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.45;
    content: "";
  }

  .admin-user-table td > * {
    min-width: 0;
  }

  .admin-user-table td strong {
    font-size: 17px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
  }

  .admin-user-subtext {
    margin-top: 4px;
    white-space: normal;
    word-break: break-word;
  }

  .admin-user-pill {
    min-height: 32px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .admin-user-table td:nth-child(5) {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px 10px;
    position: relative;
  }

  .admin-user-table td:nth-child(5)::before {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .admin-user-table td:nth-child(5) .admin-user-pill {
    justify-self: start;
  }

  .admin-user-table td:nth-child(7),
  .admin-user-table td:nth-child(8) {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .admin-user-table td:nth-child(7) > :not(:first-child),
  .admin-user-table td:nth-child(8) > :not(:first-child),
  .admin-user-table td:nth-child(9) > :not(:first-child),
  .admin-user-table td:nth-child(10) > :not(:first-child) {
    min-width: 0;
  }

  .admin-user-table td:nth-child(7) .admin-link-button,
  .admin-user-table td:nth-child(8) .admin-link-button,
  .admin-user-table td:nth-child(9) .admin-link-button {
    justify-self: start;
  }

  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(1)::before { content: "创建时间"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(2)::before { content: "用户名"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(3)::before { content: "邀请码"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(4)::before { content: "备注"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(5)::before { content: "用户分组"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(6)::before { content: "会员有效期"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(7)::before { content: "协议"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(8)::before { content: "邀请人"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(9)::before { content: "邀请成果"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(10)::before { content: "充值次数"; }
  .admin-user-table:not(.admin-demand-table):not(.admin-recharge-table):not(.admin-behavior-table):not(.admin-behavior-top-table) td:nth-child(11)::before { content: "操作"; }

  .admin-behavior-table td:nth-child(1)::before { content: "时间"; }
  .admin-behavior-table td:nth-child(2)::before { content: "用户"; }
  .admin-behavior-table td:nth-child(3)::before { content: "事件"; }
  .admin-behavior-table td:nth-child(4)::before { content: "分类"; }
  .admin-behavior-table td:nth-child(5)::before { content: "页面"; }

  .admin-behavior-top-table td:nth-child(1)::before { content: "事件"; }
  .admin-behavior-top-table td:nth-child(2)::before { content: "分类"; }
  .admin-behavior-top-table td:nth-child(3)::before { content: "次数"; }

  .admin-invite-table td:nth-child(1)::before { content: "邀请时间"; }
  .admin-invite-table td:nth-child(2)::before { content: "用户名"; }
  .admin-invite-table td:nth-child(3)::before { content: "用户 ID"; }
  .admin-invite-table td:nth-child(4)::before { content: "注册类型"; }
  .admin-invite-table td:nth-child(5)::before { content: "充值状态"; }
  .admin-invite-table td:nth-child(6)::before { content: "充值时间"; }

  .admin-demand-table td:nth-child(1)::before { content: "提交时间"; }
  .admin-demand-table td:nth-child(2)::before { content: "用户"; }
  .admin-demand-table td:nth-child(3)::before { content: "需求"; }
  .admin-demand-table td:nth-child(4)::before { content: "状态"; }

  .admin-recharge-table td:nth-child(1)::before { content: "充值时间"; }
  .admin-recharge-table td:nth-child(2)::before { content: "用户"; }
  .admin-recharge-table td:nth-child(3)::before { content: "金额"; }
  .admin-recharge-table td:nth-child(4)::before { content: "渠道"; }
  .admin-recharge-table td:nth-child(5)::before { content: "状态"; }
  .admin-recharge-table td:nth-child(6)::before { content: "说明"; }
  .admin-recharge-table td:nth-child(7)::before { content: "交易号"; }
  .admin-recharge-table td:nth-child(8)::before { content: "创建时间"; }

  .admin-empty-row {
    display: block !important;
    text-align: left;
  }

  .admin-empty-row::before {
    display: none;
  }

  .admin-status-select {
    width: 100%;
  }

  .admin-recharge-dialog {
    width: 100%;
    max-height: min(58vh, 460px);
    overflow: auto;
  }

  .admin-recharge-dialog .admin-user-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-recharge-dialog .admin-user-table,
  .admin-recharge-dialog .admin-user-table thead,
  .admin-recharge-dialog .admin-user-table tbody,
  .admin-recharge-dialog .admin-user-table tr,
  .admin-recharge-dialog .admin-user-table th,
  .admin-recharge-dialog .admin-user-table td {
    display: revert;
  }

  .admin-recharge-dialog .admin-user-table {
    min-width: 980px;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .admin-recharge-dialog .admin-user-table thead {
    display: table-header-group;
  }

  .admin-recharge-dialog .admin-user-table tbody {
    display: table-row-group;
  }

  .admin-recharge-dialog .admin-user-table tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }

  .admin-recharge-dialog .admin-user-table th,
  .admin-recharge-dialog .admin-user-table td {
    display: table-cell;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    vertical-align: middle;
  }

  .admin-recharge-dialog .admin-user-table td::before {
    display: none;
  }

  .tool-category-admin {
    gap: 12px;
    margin-top: 12px;
  }

  .tool-category-section {
    gap: 8px;
    border-radius: 16px;
    padding: 10px;
  }

  .tool-category-section-head {
    gap: 8px;
  }

  .tool-category-section-head .settings-actions,
  .tool-category-settings-item .settings-actions {
    justify-self: stretch;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-category-settings-item {
    gap: 6px;
  }

  .settings-main.tool-category-settings-main {
    min-height: 44px;
    padding: 6px 9px;
  }

  .tool-category-settings-side {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 6px;
  }

  .tool-category-settings-actions {
    justify-self: stretch;
  }

  .tool-category-settings-side .tool-custom-select-trigger {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .tool-category-footer-actions {
    justify-content: stretch;
  }

  .modal {
    justify-items: center;
    padding: 14px;
    overflow: hidden;
  }

  .settings-card,
  .invite-member-card,
  #memberModal .modal-card,
  .account-login-card,
  .password-card {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    max-height: calc(100svh - 28px);
    padding: 18px;
    overflow-y: auto;
  }

  .settings-card {
    gap: 10px;
    padding: 16px;
    overflow: hidden;
  }

  .settings-card h2 {
    max-width: calc(100% - 48px);
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
  }

  .settings-card .close-btn {
    top: 14px;
    right: 14px;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 24px;
  }

  .member-expiry,
  .invite-code-box {
    padding: 9px 10px;
  }

  .invite-member-card {
    gap: 12px;
  }

  .invite-code-inline {
    gap: 8px;
  }

  .invite-code-box strong {
    min-width: 0;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .invite-code-box span {
    font-size: 12px;
    white-space: nowrap;
  }

  .invite-copy-btn {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .invite-member-actions {
    gap: 8px;
  }

  .invite-member-actions .primary-btn,
  .invite-member-actions .secondary-btn {
    min-height: 44px;
  }

  .system-dialog-card {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    max-height: calc(100svh - 28px);
    padding: 24px 18px 20px;
    overflow-y: auto;
  }

  .system-dialog-login .system-dialog-checkbox {
    font-size: 10px;
  }

  .system-dialog-login .system-dialog-links {
    gap: 4px;
  }

  .quick-create .input-row,
  .option-editor .input-row {
    flex-direction: row;
  }

  .quick-create .input-row .primary-btn,
  .option-editor .input-row .secondary-btn {
    width: auto;
    flex-basis: 76px;
    min-width: 76px;
  }

  .tool-action-bar .primary-btn,
  .tool-action-bar .secondary-btn,
  .tool-action-bar .ghost-btn {
    width: auto;
  }

  .tool-inline-editor {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .tool-inline-actions {
    justify-content: start;
  }

  .family-tier {
    grid-template-columns: 72px minmax(520px, 1fr);
  }

  .family-tree-panel {
    height: clamp(280px, 46vh, 380px);
    overflow: hidden;
  }

  .family-tree-graph,
  .family-tree-canvas {
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .family-tier-label {
    font-size: 11px;
  }

  .family-tree-spine {
    left: calc(72px + 50%);
  }

  .family-branch,
  .family-root {
    min-width: 520px;
  }

  .family-root-node {
    width: 92px;
    height: 92px;
  }

  .family-generation {
    grid-template-columns: minmax(0, 1fr);
  }

  .family-trunk {
    left: 50%;
  }

  .family-generation-stage,
  .family-root {
    min-width: 520px;
  }

  .family-person-self {
    width: 96px;
    height: 96px;
  }

  .draw-panel,
  .side-column .panel {
    padding: 16px;
  }

  .tool-editor,
  .tool-records {
    padding: 16px;
  }

  .settings-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 50px;
    padding: 0;
  }

  .settings-main {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
    min-height: 50px;
    padding: 7px 9px;
  }

  .settings-index {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .settings-list {
    padding-right: 10px;
  }

  .settings-actions {
    grid-column: auto;
    justify-self: end;
    display: grid;
    grid-template-columns: repeat(4, 28px);
    gap: 6px;
    margin-top: 0;
  }

  .settings-action-circle,
  .settings-action-check {
    width: 28px;
    height: 28px;
  }

  .draw-heading {
    align-items: start;
    flex-direction: column;
  }

  .draw-heading .ghost-btn {
    width: auto;
  }

  .topbar-actions {
    display: contents;
  }

  .topbar-lede {
    margin-top: 6px;
    font-size: 14px;
  }

  .admin-menu-btn,
  .avatar-btn {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .admin-menu {
    right: 10px;
  }

  .tool-record {
    flex-direction: column;
  }

  .tool-mobile-inline-editor {
    display: grid;
    gap: 10px;
    margin: 0 0 12px;
    padding: 12px 12px 14px;
    border: 1px solid rgba(223, 226, 221, 0.95);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(23, 33, 29, 0.05);
    overflow: visible;
  }

  .tool-mobile-inline-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: visible;
  }

  .tool-mobile-inline-editor .tool-inline-field {
    grid-column: 1 / -1;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    overflow: visible;
  }

  .tool-mobile-inline-editor .tool-inline-wide {
    grid-column: 1 / -1;
  }

  .tool-mobile-inline-editor .tool-inline-field span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.3;
  }

  .tool-mobile-inline-editor .tool-inline-field input,
  .tool-mobile-inline-editor .tool-inline-field select,
  .tool-mobile-inline-editor .tool-inline-field textarea {
    min-height: 38px;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    background: #ffffff;
  }

  .tool-mobile-inline-editor .tool-inline-field input[type="date"] {
    padding-right: 12px;
  }

  .tool-mobile-inline-editor .tool-inline-field textarea {
    min-height: 64px;
    padding-block: 8px;
  }

  .tool-mobile-inline-editor .tool-managed-select,
  .tool-mobile-inline-editor .tool-managed-select-row {
    width: 100%;
  }

  .tool-mobile-inline-editor .tool-managed-select-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .tool-mobile-inline-editor .tool-managed-control-btn {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .tool-mobile-inline-editor .tool-inline-field + .tool-inline-field {
    margin-top: 0;
  }

  .tool-mobile-inline-editor .tool-inline-field input,
  .tool-mobile-inline-editor .tool-inline-field select,
  .tool-mobile-inline-editor .tool-inline-field textarea {
    max-width: 100%;
  }

  .tool-mobile-inline-editor .tool-custom-select-trigger {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .tool-mobile-inline-editor .tool-custom-select-menu {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    margin-top: 6px;
    max-height: 188px;
  }

  .tool-mobile-inline-editor .tool-inline-field textarea,
  .tool-mobile-inline-editor .tool-inline-field.tool-inline-wide textarea {
    width: 100%;
  }

  .tool-mobile-inline-editor .tool-inline-field:has(textarea) {
    grid-column: 1 / -1;
  }

  .tool-mobile-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
  }

  .tool-mobile-inline-actions .primary-btn,
  .tool-mobile-inline-actions .ghost-btn {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
  }

  .tool-inline-row {
    display: none;
  }

  .tool-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tool-table {
    font-size: 12px;
  }

  .tool-table th,
  .tool-table td {
    padding: 8px 8px;
  }

  .tool-table td:last-child {
    width: 72px;
  }

  .tool-form-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .tool-module-editor .section-title,
  .section-title {
    align-items: stretch;
    gap: 10px;
    flex-direction: column;
  }

  .tool-module-records .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-direction: row;
  }

  .history-panel-inline .section-title {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-direction: row;
  }

  .history-panel-inline .section-title h2,
  #clearHistoryBtn {
    white-space: nowrap;
  }

  #clearHistoryBtn {
    flex: 0 0 auto;
  }

  .tool-module-records .section-title h2,
  .tool-module-editor .section-title h2 {
    font-size: 18px;
    white-space: nowrap;
  }

  .tool-record-actions,
  .tool-table-actions,
  .tool-form-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .tool-record-actions > *,
  .tool-table-actions > *,
  .tool-form-actions > * {
    flex: 0 0 auto;
  }

  .tool-actions-desktop {
    display: none;
  }

  .tool-card-more {
    display: block;
  }

  .tool-record,
  .tool-empty {
    border-radius: 16px;
    padding: 14px 14px 12px;
    border-color: var(--mobile-record-card-border);
    background: var(--mobile-record-card-bg);
    box-shadow: var(--mobile-record-card-shadow);
  }

  .tool-record:has(.tool-record-actions) {
    position: relative;
  }

  .tool-record:has(.tool-record-actions) .tool-record-main {
    padding-right: 0;
  }

  .tool-record {
    position: relative;
  }

  .tool-record .tool-record-main {
    position: relative;
    padding-right: 40px;
  }

  .tool-record-inline-editor {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .tool-record-inline-editor .tool-mobile-inline-editor {
    margin: 0;
  }

  .tool-record .tool-record-main > .tool-card-more {
    position: absolute;
    top: 0;
    right: 0;
  }

  .tool-record-actions {
    display: none;
  }

  .tool-table-actions {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .tool-table-actions .tool-card-more {
    display: block;
    margin-left: auto;
  }

  .admin-user-action-icon {
    display: none;
  }

  .admin-user-action-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tool-module-records .section-title .tool-title-action,
  .tool-module-records .section-title .tool-title-text-action {
    margin-left: auto;
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    padding-right: 12px;
    padding-left: 12px;
  }

  .tool-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: visible;
    padding-bottom: 8px;
  }

  .tool-table,
  .tool-table thead,
  .tool-table tbody,
  .tool-table tr,
  .tool-table th,
  .tool-table td {
    display: block;
  }

  .tool-table {
    width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    table-layout: auto;
  }

  .tool-table thead {
    display: none;
  }

  .tool-table tbody {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 14px;
  }

  .tool-table tbody tr {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--mobile-record-card-border);
    border-radius: 16px;
    background: var(--mobile-record-card-bg);
    padding: 14px 48px 12px 14px;
    box-shadow: var(--mobile-record-card-shadow);
  }

  .tool-table td {
    display: grid;
    grid-template-columns: minmax(58px, 68px) minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 10px;
    border-bottom: 0;
    padding: 7px 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .tool-table colgroup {
    display: none;
  }

  .tool-table td > * {
    min-width: 0;
    max-width: 100%;
  }

  .tool-table td:last-child {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
    min-width: 24px;
    border-bottom: 0;
    padding: 0;
    display: block;
    text-align: right;
  }

  .tool-table td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    content: attr(data-label);
  }

  .tool-table td:last-child::before {
    display: none;
  }

  .tool-table-actions {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0;
    margin-left: auto;
  }

  .tool-empty-row td {
    display: block;
    padding: 0;
    border-bottom: 0;
  }

  .tool-empty-row td::before {
    display: none;
  }

  .tool-table tbody tr.tool-empty-row {
    padding: 0;
    box-shadow: none;
    border-style: dashed;
    background: #fcfbf7;
  }

  .tool-record.is-done {
    background: var(--mobile-record-card-done-bg);
  }

  .tool-table tbody tr.tool-empty-row td:last-child {
    position: static;
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .tool-table tbody tr.tool-empty-row span {
    min-height: 56px;
    justify-content: center;
    text-align: center;
  }

  .tool-period-overview {
    padding: 14px;
  }

  .tool-period-overview-main {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tool-mobile-inline-actions {
    flex-wrap: wrap;
  }

  .tool-inline-editor {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) and (max-height: 760px) {
  body.is-miniprogram-entry .topbar h1 {
    font-size: 28px;
  }

  body.is-miniprogram-entry .quick-create {
    gap: 7px;
    margin-bottom: 8px;
    padding-bottom: 10px;
  }

  body.is-miniprogram-entry .draw-panel {
    gap: 10px;
  }

  body.is-miniprogram-entry .draw-button {
    min-height: 142px;
  }

  body.is-miniprogram-entry .box-lid {
    width: min(160px, 54vw);
    height: 32px;
  }

  body.is-miniprogram-entry .box-body {
    width: min(142px, 48vw);
    height: 82px;
  }
}

.tool-field:has(.tool-native-select:focus),
.tool-inline-field:has(.tool-native-select:focus),
.tool-category-settings-item:has(.tool-native-select:focus) {
  position: relative;
  z-index: 26;
}

.tool-native-select {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  border: 1px solid #d9ddd7;
  border-radius: 10px;
  background-color: #ffffff;
  color: var(--ink);
  box-sizing: border-box;
  padding: 0 34px 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8a857a 50%), linear-gradient(135deg, #8a857a 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.tool-native-select:disabled {
  color: #7f8b82;
  opacity: 0.56;
}

.tool-native-select:focus,
.tool-native-select:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 93, 74, 0.08);
}

.tool-managed-select .tool-native-select,
.tool-managed-select-row > .tool-native-select {
  width: 100%;
  min-width: 0;
}

.tool-mobile-inline-editor {
  display: none;
}

.tool-mobile-inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-mobile-inline-editor .tool-inline-wide,
.tool-mobile-inline-editor .tool-inline-field:has(textarea) {
  grid-column: 1 / -1;
}

.tool-mobile-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-mobile-inline-actions .primary-btn,
.tool-mobile-inline-actions .ghost-btn {
  min-height: 36px;
  padding: 0 14px;
}

.tool-category-settings-side .tool-native-select {
  min-height: 36px;
  border-radius: 10px;
  padding: 7px 30px 7px 10px;
  font-size: 13px;
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
}

@media (max-width: 720px) {
  .tool-mobile-inline-editor {
    display: grid;
    gap: 12px;
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid rgba(223, 226, 221, 0.95);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(23, 33, 29, 0.05);
    overflow: visible;
  }

  .tool-mobile-inline-editor .tool-native-select {
    min-height: 38px;
    padding: 8px 34px 8px 12px;
    font-size: 13px;
    background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  }

  .tool-category-settings-side .tool-native-select {
    min-height: 34px;
    padding: 6px 28px 6px 10px;
    font-size: 13px;
  }
}
