:root {
  color-scheme: light;
  --ink: #202820;
  --soft-ink: #526052;
  --muted: #818d80;
  --line: #e1e8df;
  --green: #438759;
  --green-dark: #254f32;
  --green-pale: #eaf4e8;
  --mono: "Cascadia Code", Consolas, monospace;
  --sans: "Segoe UI", Arial, sans-serif;
  --display: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: linear-gradient(145deg, #fff 0%, #f8fbf7 44%, #e8f3e5 100%); font-family: var(--sans); }
a { color: inherit; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid #4e9a63; outline-offset: 3px; }

.app-layout { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 25px 16px 17px; border-right: 1px solid #e2e9e0; background: #ffffffd9; backdrop-filter: blur(14px); }
.brand { display: inline-flex; width: max-content; align-items: center; gap: 10px; padding: 0 8px; color: #25362a; font: 700 21px var(--display); letter-spacing: -.06em; text-decoration: none; }
.brand > span:last-child > span { color: var(--green); }
.brand-mark { position: relative; display: inline-flex; width: 31px; height: 31px; align-items: end; justify-content: center; gap: 3px; padding: 7px; overflow: hidden; border-radius: 10px; background: #e8f3e5; }
.brand-mark i { display: block; width: 4px; border-radius: 4px; background: #4d8c5b; transform: skew(-20deg); }
.brand-mark i:nth-child(1) { height: 9px; opacity: .65; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 11px; opacity: .8; }
.side-caption { margin: 38px 10px 11px; color: #899489; font: 8px var(--mono); letter-spacing: .09em; }
.side-nav { display: grid; gap: 4px; }
.nav-link { display: flex; min-height: 42px; align-items: center; gap: 11px; padding: 0 11px; border: 1px solid transparent; border-radius: 7px; color: #647064; font-size: 12px; font-weight: 600; text-decoration: none; transition: color .15s, background .15s, border-color .15s; }
.nav-link:hover { background: #f4f8f2; color: #356d42; }
.nav-link.is-active { border-color: #e0ebdd; background: #edf5ea; color: #326b40; }
.nav-icon { display: grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; color: #749579; font-size: 15px; }
.nav-link.is-active .nav-icon { color: #3f8050; }
.sidebar-bottom { margin-top: auto; }
.sidebar-network { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid #e4ece1; border-radius: 8px; background: #f9fcf8; }
.network-status-dot, .live-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #58a66a; box-shadow: 0 0 0 3px #58a66a18; }
.sidebar-network strong, .sidebar-network small { display: block; }
.sidebar-network strong { color: #49634b; font-size: 10px; font-weight: 600; }
.sidebar-network small { margin-top: 4px; color: #899489; font: 8px var(--mono); }
.sidebar-bottom > p { margin: 11px 4px 0; color: #929d91; font-size: 9px; line-height: 1.6; }

.workspace { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.topbar { position: sticky; z-index: 4; top: 0; display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(22px, 4vw, 52px); border-bottom: 1px solid #e7ece5; background: #ffffffed; backdrop-filter: blur(14px); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: #899489; font-size: 10px; }
.breadcrumbs b { color: #c1c9be; font-weight: 400; }
.breadcrumbs strong { color: #49594b; font-weight: 600; }
.topbar-community { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.topbar-community .social-link, .contract-status { display: inline-flex; min-height: 30px; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid #e1e9de; border-radius: 6px; background: #fbfdfb; color: #456b4b; font-size: 10px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.topbar-community .social-link:hover { border-color: #9fc6a0; background: #f5faf3; }
.x-icon { width: 13px; height: 13px; fill: currentColor; }
.contract-status { background: #f5f8f3; color: #718171; font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.updated-at { color: #899489; font: 8px var(--mono); }
.refresh-button { display: inline-flex; min-height: 33px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #dce7d9; border-radius: 6px; background: #fff; color: #456b4b; cursor: pointer; font-size: 10px; font-weight: 600; }
.refresh-button:hover { border-color: #9fc6a0; background: #f5faf3; }
.refresh-button span { font-size: 15px; }
.main-content { width: min(1440px, 100%); flex: 1; margin: 0 auto; padding: 35px clamp(22px, 4vw, 52px) 44px; }
.page-view[hidden] { display: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 8px 0 6px; color: #26342a; font: 650 clamp(26px, 3vw, 34px)/1.1 var(--display); letter-spacing: -.055em; }
.eyebrow { margin: 0; color: #719072; font: 8px var(--mono); letter-spacing: .11em; }
.eyebrow > span { color: #aac4a7; }
.page-description { margin: 0; color: #7a877a; font-size: 11px; line-height: 1.7; }
.compact-heading { min-height: 105px; }
.block-card { display: flex; min-width: 180px; align-items: center; gap: 11px; padding: 12px 15px; border: 1px solid #dfe9dc; border-radius: 9px; background: #ffffffc9; }
.block-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 8px; background: #ecf5e9; color: #51875a; font: 16px var(--display); }
.block-card small, .block-card strong { display: block; }
.block-card small { color: #889488; font: 7px var(--mono); letter-spacing: .08em; }
.block-card strong { margin-top: 4px; color: #385c3d; font: 600 13px var(--mono); }
.block-card .live-dot { margin-left: auto; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 112px; padding: 16px 17px 13px; border: 1px solid #e0e8dd; border-radius: 9px; background: #ffffffd9; box-shadow: 0 4px 16px #334f3209; }
.metric-card > span { display: flex; align-items: center; gap: 5px; color: #778477; font: 8px var(--mono); letter-spacing: .045em; }
.metric-card > span small { color: #88a289; font-size: 7px; }
.metric-card > strong { display: block; margin-top: 13px; color: #2d5034; font: 650 25px/1 var(--display); letter-spacing: -.05em; }
.metric-card > p { margin: 8px 0 0; color: #899389; font-size: 9px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); gap: 14px; align-items: start; }
.panel { min-width: 0; border: 1px solid #e0e8dd; border-radius: 9px; background: #ffffffdf; box-shadow: 0 4px 18px #334f3209; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 18px 14px; }
.panel-heading h2 { margin: 6px 0 0; color: #2b3a2e; font: 600 16px var(--display); letter-spacing: -.035em; }
.text-link { color: #4d8255; font-size: 9px; font-weight: 600; text-decoration: none; }
.text-link span { margin-left: 3px; font-size: 13px; }
.status-chip { padding: 5px 8px; border: 1px solid #e0e8dd; border-radius: 12px; color: #778477; font: 8px var(--mono); white-space: nowrap; }
.status-chip.online { border-color: #d7e9d5; background: #f0f8ee; color: #478052; }
.status-chip.offline { border-color: #f0ddd3; background: #fff8f4; color: #a35f46; }
.network-details { display: grid; padding: 0 18px; }
.network-details > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #edf1eb; color: #879287; font-size: 9px; }
.network-details strong { color: #59685a; font-size: 9px; font-weight: 600; }
.info-note { margin: 8px 18px 16px; padding: 10px; border: 1px solid #e5ede1; border-radius: 6px; background: #f7fbf5; color: #718171; font-size: 9px; line-height: 1.6; }

.data-panel { overflow: hidden; }
.data-count { color: #849084; font: 8px var(--mono); }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px 13px; }
.search-box { display: flex; width: min(330px, 75%); min-height: 34px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #e2e9e0; border-radius: 6px; background: #fbfdfb; color: #819080; }
.search-box > span { font-size: 17px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #344337; font-size: 10px; }
.search-box input::placeholder { color: #a1aaa1; }
.search-box:focus-within { border-color: #98bd98; box-shadow: 0 0 0 3px #89b9891a; }
.table-caption { color: #929c92; font: 8px var(--mono); text-align: right; }
.table-scroll { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #f6f9f5; }
th { padding: 10px 13px; color: #899489; font: 8px var(--mono); letter-spacing: .05em; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
td { max-width: 330px; padding: 12px 13px; border-top: 1px solid #edf1eb; color: #5e6a60; font: 9px var(--mono); white-space: nowrap; }
td a { color: #43764c; text-decoration: none; }
td a:hover { text-decoration: underline; }
.table-state { height: 94px; color: #8b968b; font: 10px var(--sans); text-align: center; white-space: normal; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .8fr); gap: 14px; }
.chart-wrap { display: flex; height: 225px; align-items: end; gap: 8px; padding: 15px 20px 18px; }
.chart-column { display: flex; height: 100%; flex: 1; flex-direction: column; align-items: center; justify-content: end; gap: 8px; }
.chart-bar { width: min(30px, 75%); min-height: 5px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #78b17b, #478854); }
.chart-column small { color: #899489; font: 7px var(--mono); }
.category-list { display: grid; padding: 0 18px 14px; }
.category-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 11px 0; border-top: 1px solid #edf1eb; color: #586659; font-size: 10px; text-transform: capitalize; }
.category-row strong { color: #68806b; font: 8px var(--mono); }
.category-row small { grid-column: 1 / -1; color: #899489; font: 8px var(--mono); }

.clone-warning { max-width: 950px; margin-bottom: 15px; padding: 17px 19px; border-color: #ecdcc8; background: #fffaf2; }
.clone-warning strong { color: #805c26; font-size: 12px; }
.clone-warning p, .clone-after p { margin: 8px 0 0; color: #766f61; font-size: 10px; line-height: 1.75; }
.clone-builder { margin-top: 15px; padding-bottom: 18px; scroll-margin-top: 82px; }
.clone-source-info { display: flex; flex-wrap: wrap; gap: 8px 17px; padding: 0 18px 15px; color: #748174; font: 9px var(--mono); }
.clone-source-info a { color: #43764c; font: 600 10px var(--sans); }
.clone-params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 18px 16px; }
.clone-param { display: grid; min-width: 0; gap: 6px; color: #586659; font-size: 10px; }
.clone-param > span { font: 9px var(--mono); overflow-wrap: anywhere; }
.clone-param input, .clone-param select { width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid #dfe7dc; border-radius: 6px; background: #fbfdfb; color: #344337; font: 10px var(--mono); }
.clone-param input[readonly] { background: #f1f5ef; color: #778477; }
.clone-param small { color: #8a9589; font-size: 9px; line-height: 1.5; }
.clone-target { display: grid; gap: 6px; margin: 0 18px 14px; padding: 13px; border: 1px solid #e0e9dd; border-radius: 7px; background: #f8fbf6; }
.clone-target span { color: #7a877a; font-size: 9px; }
.clone-target strong { color: #3c6944; font: 600 12px var(--mono); overflow-wrap: anywhere; }
.clone-target small { color: #859184; font-size: 9px; line-height: 1.5; }
.clone-ack { display: flex; align-items: start; gap: 9px; margin: 0 18px; color: #6f796e; font-size: 10px; line-height: 1.65; }
.clone-ack input { flex: 0 0 auto; margin-top: 2px; accent-color: #438759; }
.clone-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 15px 18px 0; }
.primary-button, .clone-check-button { min-height: 36px; padding: 0 13px; border: 1px solid #438759; border-radius: 6px; background: #438759; color: #fff; cursor: pointer; font-size: 10px; font-weight: 600; }
.primary-button:hover:not(:disabled), .clone-check-button:hover:not(:disabled) { border-color: #347347; background: #347347; }
.primary-button:disabled, .clone-check-button:disabled { cursor: wait; opacity: .55; }
.clone-actions p { margin: 0; color: #778477; font-size: 9px; line-height: 1.6; overflow-wrap: anywhere; }
.clone-actions p.is-error { color: #a04d3e; }
.clone-actions p a { color: #43764c; }
.clone-check-cell { min-width: 190px; }
.clone-check-button { min-height: 29px; padding-inline: 9px; font-size: 9px; }
.clone-candidate-status { display: block; margin-top: 5px; color: #778477; font: 8px var(--sans); white-space: normal; }
.clone-after { max-width: 950px; margin-top: 15px; padding: 16px 18px; }
.clone-after h2 { margin: 0; color: #2b3a2e; font: 600 14px var(--display); }

.workspace-footer { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 15px; padding: 10px clamp(22px, 4vw, 52px); border-top: 1px solid #e2e9e0; color: #829082; font-size: 9px; }
.workspace-footer a { color: #57815c; text-decoration: none; }

@media (max-width: 1000px) {
  .app-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid, .analytics-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .app-layout { display: block; }
  .sidebar { position: sticky; z-index: 6; top: 0; width: 100%; height: auto; padding: 10px 13px 8px; border-right: 0; border-bottom: 1px solid #e2e9e0; }
  .sidebar > .brand { padding-left: 2px; font-size: 18px; }
  .sidebar .brand-mark { width: 27px; height: 27px; border-radius: 8px; }
  .side-caption, .sidebar-bottom { display: none; }
  .side-nav { display: flex; gap: 4px; margin-top: 9px; overflow-x: auto; scrollbar-width: thin; }
  .nav-link { min-height: 34px; flex: 0 0 auto; gap: 6px; padding: 0 9px; font-size: 9px; white-space: nowrap; }
  .nav-icon { width: 14px; font-size: 12px; }
  .topbar { min-height: 51px; flex-wrap: wrap; padding: 8px 17px; gap: 8px; }
  .topbar-community { order: 3; flex: 1 0 100%; justify-content: flex-end; gap: 7px; }
  .topbar-community .social-link, .contract-status { min-height: 27px; padding-inline: 8px; font-size: 9px; }
  .topbar-actions { gap: 8px; }
  .updated-at { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .refresh-button { min-height: 30px; padding-inline: 8px; font-size: 9px; }
  .main-content { padding: 26px 15px 32px; }
  .page-heading { align-items: start; flex-direction: column; gap: 15px; }
  .compact-heading { min-height: 95px; }
  .block-card { width: 100%; }
  .metric-grid { gap: 8px; }
  .metric-card { min-height: 102px; padding: 13px; }
  .metric-card > span { font-size: 7px; }
  .metric-card > strong { font-size: 22px; }
  .panel-heading { padding-inline: 13px; }
  .table-tools { align-items: start; flex-direction: column; padding-inline: 13px; }
  .search-box { width: 100%; }
  .table-caption { text-align: left; }
  th:first-child, td:first-child { padding-left: 13px; }
  .network-details { padding-inline: 13px; }
  .info-note { margin-inline: 13px; }
  .clone-params { grid-template-columns: 1fr; padding-inline: 13px; }
  .clone-source-info { padding-inline: 13px; }
  .clone-target { margin-inline: 13px; }
  .clone-ack { margin-inline: 13px; }
  .clone-actions { align-items: start; flex-direction: column; margin-inline: 13px; }
  .workspace-footer { align-items: start; flex-direction: column; padding: 13px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
