:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --panel: #fffefa;
  --panel-soft: #e9eee5;
  --sage: #dce5d7;
  --rose: #f1e5e2;
  --sand: #f0e9dd;
  --text: #343d37;
  --muted: #657064;
  --line: #e3e5dc;
  --brand: #466451;
  --brand-strong: #345140;
  --warn: #805a49;
  --bad: #925c58;
  --good: #466451;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: var(--brand); text-underline-offset: 4px; overflow-wrap: anywhere; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a9bba3; outline-offset: 4px; }
.hidden { display: none !important; }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 36px 22px 26px; background: #eeefe6; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px; }
.brand-mark { display: grid; place-items: center; flex: none; width: 43px; height: 43px; border-radius: 16px; background: var(--brand); color: #fffefa; font-size: 23px; font-weight: 650; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: .06em; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.page-switch { display: grid; gap: 6px; padding: 6px; border-radius: 18px; background: #e1e7da; margin-bottom: 30px; }
.page-switch a { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: 13px; text-decoration: none; color: #53644f; font-size: 14px; }
.page-switch a.active { background: var(--panel); color: var(--brand-strong); font-weight: 650; }
.page-switch a:hover { background: #f6f6ee; }
.nav-label { padding: 0 12px 10px; color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.nav { display: grid; gap: 5px; }
.nav a { display: flex; align-items: center; min-height: 43px; gap: 10px; padding: 10px 13px; border-radius: 13px; color: #55614f; text-decoration: none; font-size: 14px; }
.nav a:hover { background: #e1e7da; color: var(--brand-strong); }
.sidebar-note { margin-top: auto; padding: 28px 10px 0; color: var(--muted); font-size: 12px; }
.network-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #7b9874; }
.main { width: 100%; max-width: 1500px; min-width: 0; padding: 44px clamp(24px, 4vw, 64px) 64px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 9px; color: #6b7d63; font-size: 11px; font-weight: 650; letter-spacing: .18em; }
.title h2 { margin: 0; font-size: clamp(28px, 3vw, 36px); line-height: 1.3; font-weight: 620; letter-spacing: -.04em; }
.title p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.contract-caption { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px 28px; margin-bottom: 28px; border-radius: 24px; background: var(--panel-soft); }
.intro h3 { margin: 0 0 7px; font-size: 18px; font-weight: 600; }
.intro p { margin: 0; font-size: 13px; color: var(--muted); }
.intro .tag { flex: none; background: #f8faf2; }
.status { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 34px; padding: 7px 12px; border-radius: 12px; background: var(--panel-soft); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.status.ok { color: var(--good); }
.status.err { color: var(--bad); background: var(--rose); }
.wallet-box { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; max-width: 52%; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px; padding: 24px; margin-bottom: 28px; background: var(--panel); border-radius: 22px; }
.toolbar .hint { grid-column: 1 / -1; margin: 0; }
.rpc-settings { margin: -8px 0 28px; padding: 0 6px; color: var(--muted); font-size: 12px; }
.rpc-settings summary { width: fit-content; cursor: pointer; padding: 8px 0; }
.rpc-settings .field { margin: 8px 0; max-width: 600px; }
.config-details { margin: 0 0 26px; border-radius: 17px; background: #e9eee5; }
.config-details summary { cursor: pointer; padding: 16px 22px; color: #52624c; font-size: 13px; }
.config-details .deployment-summary { margin-bottom: 0; padding-top: 0; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { color: #5d695d; font-size: 12px; font-weight: 550; }
.input { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fffefb; color: var(--text); outline: none; font-size: 14px; }
.input::placeholder { color: #899183; }
.input:focus { border-color: #91a78b; box-shadow: 0 0 0 3px #edf1e8; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 13px; background: var(--brand); color: #fffefa; font-size: 13px; font-weight: 550; text-decoration: none; cursor: pointer; align-self: end; transition: background .18s, transform .18s; }
.btn:hover { background: var(--brand-strong); }
.btn.secondary { background: #e9ede3; color: #43583e; }
.btn.secondary:hover { background: #dce5d5; }
.btn.danger { background: #8f625d; }
.btn.danger:hover { background: #7d514d; }
.btn:disabled { cursor: not-allowed; background: #e2e7dd; color: #75816f; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.action-card { display: flex; flex-direction: column; min-width: 0; gap: 15px; padding: 24px; border: 0; border-radius: 20px; background: #f6f6ef; }
.action-card:nth-child(4n + 2) { background: #f5efea; }
.action-card h3 { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 620; }
.action-card p { margin: 0; }
.action-card .tag { align-self: flex-start; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.action-row .btn { flex: 1 1 auto; white-space: nowrap; }
.review-box { min-height: 82px; padding: 14px 15px; border: 0; border-radius: 13px; background: #fffefa; color: var(--muted); font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.review-box.ok { color: var(--brand-strong); background: #e6ecdf; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--muted); }
input[type="checkbox"] { accent-color: var(--brand); margin-top: 5px; }
.action-log { margin: 24px 0 0; padding: 18px 20px; border-radius: 16px; background: #e9ede3; color: var(--muted); font: 12px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.panel { grid-column: span 12; margin-bottom: 26px; border: 0; border-radius: 24px; background: var(--panel); overflow: hidden; box-shadow: 0 3px 18px #58694d04; }
.grid .panel { margin-bottom: 0; }
.panel.half { grid-column: span 6; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; padding: 23px 26px 14px; background: transparent; border: 0; }
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 620; }
.panel-body { padding: 12px 26px 26px; }
.kv { display: grid; gap: 0; border: 0; border-radius: 16px; overflow: hidden; background: #f7f7f1; }
.row { display: grid; grid-template-columns: minmax(125px, .58fr) minmax(0, 1fr); align-items: start; gap: 16px; padding: 14px 17px; min-height: 47px; }
.row:nth-child(even) { background: #f0f2e9; }
.row .key { color: var(--muted); font-size: 12px; }
.row .value { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-variant-numeric: tabular-nums; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric { min-height: 108px; padding: 19px; border: 0; border-radius: 19px; background: var(--panel-soft); }
.metric:nth-child(2) { background: var(--sand); }
.metric:nth-child(3) { background: var(--rose); }
.metric:nth-child(4) { background: #edf0e5; }
.metric label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.metric strong { display: block; overflow-wrap: anywhere; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.4; font-weight: 600; font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.85; }
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 5px 10px; border-radius: 10px; background: var(--panel-soft); color: var(--brand-strong); font-size: 11px; line-height: 1.5; }
.tag.warn { background: var(--rose); color: var(--warn); }
.empty { display: grid; place-items: center; padding: 28px; min-height: 150px; text-align: center; color: var(--muted); font-size: 13px; background: #f6f7ef; border-radius: 16px; }
.deployment-summary { margin: 0 0 28px; padding: 21px 24px; border-radius: 20px; background: var(--panel-soft); white-space: pre-wrap; overflow-wrap: anywhere; color: #52624c; font-size: 12px; line-height: 1.95; }
.extended-panel { margin-bottom: 26px; }
.extended-panel h3 { margin: 0; }
.extended-panel .action-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.action-card textarea.input { min-height: 125px; resize: vertical; }
code { padding: 2px 5px; border-radius: 5px; background: #e7ebdf; color: #4c6244; font-size: .9em; overflow-wrap: anywhere; }
[inert] { opacity: .8; }
.spinner { width: 14px; height: 14px; flex: none; border: 2px solid #c1cdb9; border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-gate { display: grid; min-height: 100vh; place-items: center; padding: 32px 20px; background: var(--bg); }
.login-card { width: min(440px, 100%); padding: 40px; border: 0; border-radius: 30px; background: var(--panel); box-shadow: 0 12px 64px #62735409; }
.login-card .brand-mark { margin-bottom: 26px; background: var(--sage); color: var(--brand-strong); }
.login-card h1 { margin: 0 0 12px; font-size: 27px; font-weight: 600; }
.login-card p { margin: 0 0 25px; font-size: 13px; color: var(--muted); }
.login-error { min-height: 22px; margin-top: 12px; color: var(--bad); font-size: 12px; }
.login-back { display: block; margin-top: 22px; font-size: 13px; text-align: center; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 35px; color: var(--muted); font-size: 12px; }
@media (min-width: 1600px) { .main { margin-inline: auto; } }
@media (max-width: 1100px) { .wallet-box { max-width: 48%; } .admin-grid { grid-template-columns: 1fr; } .panel.half { grid-column: span 12; } .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 24px; }
  .brand { padding: 0 0 20px; }
  .page-switch { grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
  .page-switch a { justify-content: center; }
  .nav-label, .sidebar-note { display: none; }
  .nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .nav a { padding: 8px 12px; min-height: 37px; font-size: 12px; }
  .main { padding: 30px 24px 48px; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 16px; }
  .sidebar { padding: 22px 20px 18px; }
  .main { padding: 27px 18px 40px; }
  .topbar { display: grid; gap: 18px; }
  .wallet-box { justify-content: flex-start; max-width: 100%; }
  .intro { align-items: flex-start; padding: 22px; gap: 12px; }
  .intro h3 { font-size: 16px; }
  .toolbar { grid-template-columns: 1fr; padding: 22px; gap: 15px; }
  .toolbar .btn { width: 100%; }
  .panel-head { padding: 21px 20px 12px; }
  .panel-body { padding: 10px 20px 22px; }
  .action-card { padding: 20px; }
  .row { grid-template-columns: 1fr; gap: 5px; padding: 13px 15px; }
  .metric-strip { gap: 10px; }
  .metric { min-height: 100px; padding: 15px; }
  .metric strong { font-size: 18px; }
  .action-row { gap: 8px; }
  .action-row .btn { padding-inline: 12px; }
  .login-card { padding: 30px; }
  .page-footer { display: grid; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .spinner { animation: none; } .btn { transition: none; } }
