:root {
  color-scheme: light;
  --bg: #f5eee1;
  --bg-deep: #eadcc0;
  --panel: rgba(255, 250, 242, 0.84);
  --panel-strong: #fffaf1;
  --panel-soft: rgba(255, 248, 235, 0.68);
  --line: rgba(143, 114, 65, 0.18);
  --line-strong: rgba(143, 114, 65, 0.28);
  --text: #2f2618;
  --muted: #74644c;
  --gold: #cf9824;
  --gold-deep: #8d5d04;
  --gold-soft: rgba(207, 152, 36, 0.16);
  --green: #13795b;
  --green-soft: rgba(19, 121, 91, 0.16);
  --red: #bb5a41;
  --red-soft: rgba(187, 90, 65, 0.16);
  --slate: #54606d;
  --slate-soft: rgba(84, 96, 109, 0.16);
  --shadow-lg: 0 30px 80px rgba(88, 58, 15, 0.16);
  --shadow-md: 0 16px 40px rgba(88, 58, 15, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 180ms ease;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 117, 0.22), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(130, 186, 152, 0.18), transparent 26%),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 54%, #ecdfc7 100%);
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.background-orb {
  position: fixed;
  z-index: 0;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(32px);
  opacity: 0.38;
  pointer-events: none;
}

.orb-left {
  left: -12rem;
  top: 4rem;
  background: rgba(223, 180, 80, 0.45);
}

.orb-right {
  right: -10rem;
  top: 24rem;
  background: rgba(93, 161, 136, 0.26);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.route-dock {
  display: flex;
  justify-content: center;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 18px;
  position: sticky;
  top: 16px;
  z-index: 24;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
}

.hero {
  display: block;
  margin-bottom: 20px;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hero-copy {
  padding: 10px 6px 10px 4px;
  max-width: 64rem;
}

.wallet-auth-slot {
  position: relative;
  flex: 0 0 auto;
  min-width: min(100%, 340px);
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 245, 220, 0.84);
  border: 1px solid rgba(192, 148, 48, 0.18);
  color: var(--gold-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 16px 0 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.hero-copy p {
  max-width: 58rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-info-card {
  max-width: 58rem;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(143, 114, 65, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 236, 0.82)),
    rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 24px rgba(126, 93, 27, 0.08);
}

.hero-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.hero-info-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.hero-info-value {
  color: var(--gold-deep);
  font-size: 0.98rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.route-switch {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(143, 114, 65, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 28px rgba(88, 58, 15, 0.08);
}

.route-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(143, 114, 65, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.route-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(207, 152, 36, 0.24);
}

.route-pill.is-active {
  color: var(--gold-deep);
  border-color: rgba(207, 152, 36, 0.28);
  background: linear-gradient(135deg, rgba(255, 247, 230, 0.95), rgba(255, 236, 189, 0.88));
}

.toolbar,
.overview,
.studio {
  padding: 24px;
}

.toolbar-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar-heading h2,
.section-heading h2 {
  margin: 10px 0 6px;
  font-size: 1.4rem;
}

.toolbar-heading p,
.section-heading p,
.muted {
  margin: 0;
  color: var(--muted);
}

.status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: #fefbf4;
  background: linear-gradient(135deg, #b67a0b, #cf9824 58%, #e7b655);
  box-shadow: 0 16px 24px rgba(182, 122, 11, 0.22);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.notice {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.notice.hidden {
  display: none;
}

.notice.info {
  background: rgba(84, 96, 109, 0.12);
  border-color: rgba(84, 96, 109, 0.18);
}

.notice.success {
  background: rgba(19, 121, 91, 0.12);
  border-color: rgba(19, 121, 91, 0.18);
}

.notice.warning {
  background: rgba(207, 152, 36, 0.14);
  border-color: rgba(207, 152, 36, 0.22);
}

.notice.error {
  background: rgba(187, 90, 65, 0.12);
  border-color: rgba(187, 90, 65, 0.18);
}

.overview {
  margin-bottom: 18px;
}

.wallet-auth-shell {
  position: relative;
}

.wallet-auth-shell.is-compact {
  display: flex;
  justify-content: flex-end;
}

.wallet-compact-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.wallet-connect-button,
.wallet-user-trigger {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(143, 114, 65, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 245, 225, 0.8)),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 32px rgba(88, 58, 15, 0.12);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.wallet-connect-button:hover,
.wallet-user-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(207, 152, 36, 0.32);
  box-shadow: 0 18px 36px rgba(88, 58, 15, 0.15);
}

.wallet-connect-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  color: var(--text);
  font-weight: 800;
}

.wallet-principal-badge {
  width: auto;
  min-width: min(100%, 180px);
  max-width: 100%;
  padding: 0 18px;
  letter-spacing: -0.01em;
}

.wallet-inline-action {
  width: auto;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(143, 114, 65, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 16px 32px rgba(88, 58, 15, 0.08);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.wallet-inline-action:hover {
  transform: translateY(-1px);
  border-color: rgba(207, 152, 36, 0.28);
  box-shadow: 0 18px 36px rgba(88, 58, 15, 0.12);
}

.wallet-inline-action.is-danger {
  color: var(--red);
  border-color: rgba(187, 90, 65, 0.18);
  background: rgba(187, 90, 65, 0.08);
}

.wallet-connect-button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.wallet-connect-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c98011, #e7bc56);
  color: #fffaf1;
  font-size: 0.86rem;
  font-weight: 800;
}

.wallet-user-trigger {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  text-align: left;
}

.wallet-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(143, 114, 65, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 246, 224, 0.98), rgba(243, 229, 193, 0.92)),
    rgba(255, 255, 255, 0.92);
  color: var(--gold-deep);
  font-weight: 800;
  object-fit: cover;
}

.wallet-user-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.wallet-user-name,
.wallet-user-principal {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-user-name {
  font-size: 0.78rem;
  color: var(--muted);
}

.wallet-user-principal {
  font-size: 0.98rem;
  font-weight: 800;
}

.wallet-user-caret {
  color: var(--muted);
  font-size: 1rem;
  transition: transform var(--transition);
}

.wallet-auth-shell.is-open .wallet-user-caret {
  transform: rotate(180deg);
}

.wallet-user-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid rgba(143, 114, 65, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 234, 0.9)),
    rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 48px rgba(47, 38, 24, 0.16);
  display: none;
}

.wallet-auth-shell.is-open .wallet-user-panel {
  display: block;
}

.wallet-user-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.wallet-user-head .wallet-avatar {
  width: 42px;
  height: 42px;
}

.wallet-user-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.wallet-user-title strong,
.wallet-user-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-user-title strong {
  font-size: 1rem;
}

.wallet-user-title span {
  color: var(--muted);
  font-size: 0.8rem;
}

.wallet-user-details {
  border-top: 1px solid rgba(143, 114, 65, 0.12);
  border-bottom: 1px solid rgba(143, 114, 65, 0.12);
  padding: 12px 0;
}

.wallet-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}

.wallet-detail-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(207, 152, 36, 0.2);
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.84);
  color: var(--gold-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.wallet-detail-copy:disabled {
  opacity: 0.72;
  cursor: default;
}

.wallet-detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wallet-detail-value {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  word-break: break-word;
  font-size: 0.9rem;
}

.wallet-user-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.wallet-user-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(143, 114, 65, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.wallet-user-action.is-danger {
  color: var(--red);
  border-color: rgba(187, 90, 65, 0.18);
  background: rgba(187, 90, 65, 0.08);
}

.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.wallet-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 24, 15, 0.46);
  backdrop-filter: blur(10px);
}

.wallet-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100dvh - 40px);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(circle at top left, rgba(255, 225, 160, 0.26), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 232, 0.9)),
    rgba(255, 255, 255, 0.94);
}

.wallet-dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(143, 114, 65, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}

.wallet-dialog-head {
  margin-bottom: 18px;
  padding-right: 56px;
}

.wallet-dialog-head h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.wallet-dialog-head p,
.wallet-dialog-foot {
  color: var(--muted);
  line-height: 1.7;
}

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

.wallet-option {
  position: relative;
  overflow: hidden;
  min-height: 156px;
  padding: 18px 16px 14px;
  border: 1px solid rgba(143, 114, 65, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 236, 0.82)),
    rgba(255, 255, 255, 0.9);
  text-align: left;
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.wallet-option:hover {
  transform: translateY(-2px);
  border-color: rgba(207, 152, 36, 0.24);
  box-shadow: 0 16px 28px rgba(88, 58, 15, 0.12);
}

.wallet-option:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wallet-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #c87c0d, #e7bb55);
  color: #fffaf1;
  font-size: 1rem;
  font-weight: 800;
}

.wallet-option-name {
  display: block;
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 800;
}

.wallet-option-desc {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.wallet-option-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px;
  border-top: 1px solid rgba(143, 114, 65, 0.08);
  background: rgba(245, 239, 225, 0.74);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.wallet-option.is-ready .wallet-option-status {
  color: var(--green);
  background: rgba(19, 121, 91, 0.08);
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 20px;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 24, 15, 0.46);
  backdrop-filter: blur(10px);
}

.app-dialog {
  position: relative;
  width: min(520px, 100%);
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 225, 160, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 247, 232, 0.92)),
    rgba(255, 255, 255, 0.96);
}

.app-dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(143, 114, 65, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}

.app-dialog-head {
  margin-bottom: 14px;
  padding-right: 56px;
}

.app-dialog-head h2 {
  margin: 12px 0 0;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.app-dialog-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.app-dialog-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.wallet-option.is-loading .wallet-option-status {
  color: var(--gold-deep);
  background: rgba(207, 152, 36, 0.12);
}

.wallet-dialog-foot {
  margin-top: 16px;
  font-size: 0.88rem;
}

.overview-heading {
  align-items: flex-end;
}

.overview-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.overview-content {
  min-height: 280px;
}

.studio-intro {
  margin: 0 0 18px;
  color: var(--muted);
}

.empty-shell {
  display: grid;
  place-items: center;
}

.empty-state {
  width: 100%;
  padding: 28px;
  border: 1px dashed rgba(143, 114, 65, 0.28);
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 252, 246, 0.56);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.overview-panel,
.overview-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.campaign-card,
.account-card,
.kpi-card,
.mini-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 236, 0.74)),
    rgba(255, 255, 255, 0.76);
}

.campaign-card {
  padding: 22px;
  display: grid;
  gap: 18px;
  align-content: start;
  height: 100%;
}

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

.overview-meta-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(143, 114, 65, 0.18);
  background: rgba(255, 252, 246, 0.62);
}

.overview-meta-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.overview-meta-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.overview-meta-value {
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
}

.overview-account-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 16px;
  height: 100%;
}

.campaign-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.campaign-title h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.campaign-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge {
  line-height: 1;
}

.tone-gold {
  color: var(--gold-deep);
  background: var(--gold-soft);
  border-color: rgba(207, 152, 36, 0.18);
}

.tone-green {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(19, 121, 91, 0.18);
}

.tone-red {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(187, 90, 65, 0.18);
}

.tone-neutral {
  color: var(--slate);
  background: var(--slate-soft);
  border-color: rgba(84, 96, 109, 0.16);
}

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

.kpi-card {
  padding: 18px;
  min-height: 0;
}

.kpi-card-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.kpi-card-value {
  display: block;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.kpi-card-sub {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.overview-side {
  grid-template-columns: 1fr;
  align-content: stretch;
}

.account-card,
.mini-panel {
  padding: 20px;
}

.overview-account-grid .account-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.overview-account-grid .account-balance {
  margin-top: auto;
}

.admin-content {
  min-height: 220px;
}

.invite-content {
  min-height: 220px;
}

.page-invite {
  overscroll-behavior-x: none;
  touch-action: pan-y pinch-zoom;
}

.page-invite .shell,
.page-invite .invite-studio,
.page-invite .invite-content,
.page-invite .invite-layout,
.page-invite .invite-card,
.page-invite .invite-link-box {
  min-width: 0;
}

.page-invite .invite-content,
.page-invite .invite-layout,
.page-invite .invite-card,
.page-invite .invite-link-box {
  overflow-x: hidden;
}

.admin-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.admin-card-wide {
  grid-column: 1 / -1;
}

.admin-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 236, 0.76)),
    rgba(255, 255, 255, 0.82);
  padding: 22px;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.admin-card-head h3 {
  margin: 10px 0 0;
  font-size: 1.28rem;
}

.admin-meta-list {
  display: grid;
  gap: 12px;
}

.admin-meta-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(143, 114, 65, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.admin-meta-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-meta-value {
  min-width: 0;
}

.admin-principal,
.admin-text {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  font-weight: 700;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-form .field {
  display: grid;
  gap: 8px;
}

.admin-form .field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-form .field input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(143, 114, 65, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.admin-form .field input:focus {
  outline: none;
  border-color: rgba(207, 152, 36, 0.4);
  box-shadow: 0 0 0 4px rgba(207, 152, 36, 0.12);
}

.admin-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-form-actions p {
  flex: 1 1 auto;
}

.admin-result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(143, 114, 65, 0.18);
}

.admin-result h4 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.admin-inline-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(84, 96, 109, 0.08);
  color: var(--muted);
  line-height: 1.6;
}

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

.admin-action-panel {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(143, 114, 65, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.admin-action-head h4 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.admin-action-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.admin-action-head code {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.9);
  color: var(--gold-deep);
  font-size: 0.9em;
}

.admin-panel-form {
  margin-top: 16px;
}

.admin-panel-actions {
  justify-content: flex-start;
}

.admin-panel-note,
.admin-panel-result {
  margin-top: 16px;
}

.admin-directory-list {
  display: grid;
  gap: 14px;
}

.admin-directory-item {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(143, 114, 65, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.admin-directory-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.admin-directory-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-directory-principal {
  min-width: 0;
  font-size: 1rem;
}

.admin-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.admin-directory-stat {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.8);
  border: 1px solid rgba(143, 114, 65, 0.1);
}

.admin-directory-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-directory-value {
  min-width: 0;
}

.button-danger {
  color: var(--red);
  background: rgba(187, 90, 65, 0.08);
  border: 1px solid rgba(187, 90, 65, 0.2);
}

.admin-remove-button {
  min-height: 42px;
  padding: 0 16px;
  white-space: nowrap;
}

.invite-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: start;
}

.invite-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 236, 0.76)),
    rgba(255, 255, 255, 0.82);
  padding: 22px;
}

.invite-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.invite-card-head h3 {
  margin: 10px 0 0;
  font-size: 1.28rem;
}

.invite-link-box {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(143, 114, 65, 0.24);
  background: rgba(255, 255, 255, 0.74);
}

.invite-link-text {
  display: block;
  width: 100%;
  max-width: 100%;
  color: var(--gold-deep);
  font-size: 0.98rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

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

.account-card h4,
.mini-panel h4 {
  margin: 0;
  font-size: 1rem;
}

.account-address {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(143, 114, 65, 0.2);
}

.account-principal {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.copy-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(207, 152, 36, 0.24);
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.92);
  color: var(--gold-deep);
  font-weight: 700;
  transition: transform var(--transition), background var(--transition), opacity var(--transition);
}

.copy-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 239, 205, 0.98);
}

.copy-button:disabled {
  opacity: 0.72;
  cursor: default;
  transform: none;
}

.account-balance {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.account-balance strong {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.mini-stats {
  display: grid;
  gap: 14px;
}

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

.mini-stat-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.mini-stat strong {
  font-size: 1.2rem;
}

.mini-bar {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(143, 114, 65, 0.12);
}

.mini-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #c78815, #e0b452);
}

.tab-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.tab-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.tab-button:hover {
  transform: translateY(-1px);
}

.tab-button.is-active {
  background: linear-gradient(135deg, rgba(255, 247, 230, 0.95), rgba(255, 236, 189, 0.88));
  border-color: rgba(207, 152, 36, 0.28);
  color: var(--gold-deep);
}

.tab-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(84, 96, 109, 0.1);
  color: var(--slate);
  font-size: 0.78rem;
}

.tab-button.is-active .tab-count {
  background: rgba(207, 152, 36, 0.12);
  color: var(--gold-deep);
}

.dataset {
  display: none;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 246, 0.62);
}

.dataset.is-active {
  display: block;
}

.dataset-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.dataset-head h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.dataset-head p {
  margin: 0;
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.filters .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: span 2;
}

.filters .field-wide {
  grid-column: span 3;
}

.filters .field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.filters .field input,
.filters .field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.92);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.filters .field input:focus,
.filters .field select:focus {
  outline: none;
  border-color: rgba(207, 152, 36, 0.7);
  box-shadow: 0 0 0 4px rgba(207, 152, 36, 0.12);
}

.filters .field-page-size {
  grid-column: span 2;
}

.filters-actions {
  grid-column: span 2;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.button-ghost {
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.dataset-summary {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.dataset-body {
  min-height: 240px;
}

.seed-network-panel {
  display: grid;
  gap: 16px;
}

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

.seed-network-copy-card,
.seed-network-summary-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(143, 114, 65, 0.14);
  background: rgba(255, 255, 255, 0.74);
}

.seed-network-copy-card {
  padding: 18px;
}

.seed-network-copy-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.seed-network-copy-label,
.seed-network-summary-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.seed-network-copy-value {
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(143, 114, 65, 0.2);
  background: rgba(255, 251, 244, 0.72);
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.seed-network-copy-value-principal .cell-main {
  margin: 0;
}

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

.seed-network-summary-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.seed-network-summary-value {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  letter-spacing: -0.04em;
}

.seed-network-summary-sub {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.loading-shell {
  display: grid;
  gap: 14px;
}

.loading-line,
.loading-block {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(143, 114, 65, 0.1);
}

.loading-line::after,
.loading-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: shimmer 1.3s infinite;
}

.loading-line {
  height: 18px;
}

.loading-block {
  height: 88px;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(143, 114, 65, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.data-table thead th {
  padding: 14px 16px;
  text-align: left;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(143, 114, 65, 0.16);
  background: rgba(249, 243, 232, 0.84);
}

.data-table tbody td {
  padding: 16px;
  border-bottom: 1px solid rgba(143, 114, 65, 0.1);
  vertical-align: top;
}

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

.data-table tbody tr:hover {
  background: rgba(255, 250, 238, 0.78);
}

.cell-main {
  display: block;
  font-weight: 700;
}

.cell-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.mono {
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
}

.principal-display {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  white-space: nowrap;
  cursor: default;
}

.principal-link {
  color: var(--gold-deep);
  text-decoration: none;
  cursor: pointer;
}

.principal-link:hover {
  text-decoration: underline;
}

.principal-display:hover {
  color: var(--gold-deep);
}

.principal-display[data-full-value]:hover::after {
  content: attr(data-full-value);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 10;
  width: max-content;
  max-width: min(36rem, 80vw);
  padding: 10px 12px;
  border: 1px solid rgba(143, 114, 65, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(47, 38, 24, 0.94);
  color: #fffaf1;
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 14px 30px rgba(47, 38, 24, 0.24);
}

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
}

.pagination-info {
  color: var(--muted);
  font-size: 0.92rem;
}

.pagination-actions {
  display: flex;
  gap: 10px;
}

.pagination-actions button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-weight: 700;
}

.dataset-error {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(187, 90, 65, 0.08);
  border: 1px solid rgba(187, 90, 65, 0.18);
}

.dataset-error h4 {
  margin: 0 0 8px;
}

.dataset-error p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .hero-top {
    flex-direction: column;
    align-items: stretch;
  }

  .wallet-auth-slot {
    min-width: 0;
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-account-grid {
    grid-template-rows: none;
    height: auto;
  }

  .seed-network-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .invite-layout {
    grid-template-columns: 1fr;
  }

  .admin-action-grid {
    grid-template-columns: 1fr;
  }

  .admin-directory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  }

  .shell {
    width: min(100% - 20px, 100%);
    padding: 18px 0 calc(env(safe-area-inset-bottom, 0px) + 108px);
  }

  .route-dock {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    top: auto;
    width: min(calc(100vw - 20px), 640px);
    margin: 0;
    transform: translate3d(-50%, 0, 0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: 28;
  }

  .hero-copy h1 {
    font-size: 2.3rem;
  }

  .hero-info-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .route-switch {
    width: 100%;
    gap: 8px;
    padding: 10px;
    justify-content: space-between;
    border-radius: 22px;
    background: rgba(255, 249, 240, 0.92);
    box-shadow: 0 18px 36px rgba(47, 38, 24, 0.16);
  }

  .route-pill {
    flex: 1 1 0;
    min-width: 0;
    min-height: 46px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .wallet-compact-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .wallet-principal-badge {
    flex: 1 1 0;
    min-width: 0;
  }

  .wallet-user-panel {
    width: 100%;
    right: auto;
    left: 0;
  }

  .wallet-user-actions {
    flex-direction: column;
  }

  .wallet-dialog {
    align-self: start;
    width: min(100%, 560px);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
    padding: 20px 18px;
  }

  .wallet-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar,
  .overview,
  .studio {
    padding: 18px;
  }

  .toolbar-heading,
  .section-heading,
  .dataset-head,
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .status-stack {
    align-items: flex-start;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters .field,
  .filters .field-wide,
  .filters .field-page-size,
  .filters-actions {
    grid-column: auto;
  }

  .overview-actions,
  .filters-actions,
  .admin-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .account-head {
    align-items: flex-start;
  }

  .admin-directory-top {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-remove-button {
    width: 100%;
  }

  .overview-meta-grid,
  .seed-network-top-grid,
  .seed-network-summary-grid,
  .overview-account-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: unset;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .data-table tbody tr {
    border: 1px solid rgba(143, 114, 65, 0.14);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.78);
    overflow: hidden;
  }

  .data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.78);
  }

  .data-table tbody td {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 16px;
  }

  .data-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
  }
}

@media (max-width: 520px) {
  .wallet-modal {
    place-items: start center;
    padding:
      calc(env(safe-area-inset-top, 0px) + 12px)
      12px
      calc(env(safe-area-inset-bottom, 0px) + 16px);
  }

  .wallet-dialog {
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 28px);
    border-radius: 24px;
  }

  .wallet-options {
    grid-template-columns: 1fr;
  }

  .wallet-option {
    min-height: 144px;
  }

  .wallet-detail-row {
    flex-direction: column;
  }
}
