@import url("https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap");

:root {
  color-scheme: light;
  --bg: #eef3f6;
  --ink: #172033;
  --muted: #667085;
  --panel: #ffffff;
  --line: #d7e1ea;
  --side: #111a24;
  --teal: #167d74;
  --teal-dark: #0d625b;
  --blue: #2b5f99;
  --red: #c44536;
  --amber: #b7791f;
  --green-soft: #def4eb;
  --blue-soft: #e8f0ff;
  --red-soft: #fde8e4;
  --amber-soft: #fff3d6;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(238, 243, 246, 0.86)),
    var(--bg);
  color: var(--ink);
  font-family: Ubuntu, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}

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

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 22% 18%, rgba(22, 125, 116, 0.14), transparent 34%),
    linear-gradient(135deg, #f8fbfc 0%, #e9f1f5 48%, #f4f7f8 100%);
}

.login-card {
  display: grid;
  width: min(438px, 100%);
  gap: 14px;
  border: 1px solid rgba(215, 225, 234, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 28px;
  box-shadow: 0 24px 70px rgba(17, 26, 36, 0.13);
}

.login-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0;
}

.login-card h1 {
  margin-bottom: 0;
  font-size: 34px;
}

.login-card .lead {
  margin-bottom: 4px;
  font-size: 14px;
}

.login-error {
  display: none;
  margin: -2px 0 0;
  border: 1px solid #f2c2bb;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  padding: 9px 11px;
  font-size: 13px;
}

.login-error.is-visible {
  display: block;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 34%),
    var(--side);
  color: #f8fafc;
  padding: 24px 20px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 36px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--teal);
  font-weight: 700;
  font-size: 13px;
}

.brand span,
.eyebrow,
.lead,
.panel p,
.status span,
label {
  color: var(--muted);
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #aeb8c7;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.nav a.active,
.nav a:hover {
  background: #243044;
  color: #ffffff;
}

.mobile-nav-toggle,
.mobile-nav-close,
.mobile-nav-backdrop {
  display: none;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 700;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 700;
}

h3 {
  margin-bottom: 7px;
  font-size: 16px;
  font-weight: 700;
}

.lead {
  max-width: 820px;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.55;
}

.status {
  display: grid;
  min-width: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 14px;
}

.status span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status strong {
  margin-top: 5px;
  color: var(--teal);
  font-size: 20px;
  font-weight: 700;
}

.logout-button {
  height: 28px;
  margin-top: 10px;
  border-color: #e3ebf2;
  background: #f6f9fb;
  color: #475569;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 26px;
}

.panel {
  min-width: 0;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.045);
}

#tsunami.panel {
  padding: 18px 18px 20px;
}

.is-hidden {
  display: none;
}

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

.panel-head p {
  margin-bottom: 0;
  max-width: 780px;
}

.controls {
  display: grid;
  grid-template-columns: 150px 170px;
  gap: 10px;
  flex: 0 0 auto;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

fieldset {
  margin: 0;
  min-width: 0;
  border: 0;
  padding: 0;
}

legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
input,
button {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 11px;
  font: inherit;
  font-weight: 400;
  line-height: 40px;
  vertical-align: middle;
}

select {
  appearance: none;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #475569 50%),
    linear-gradient(135deg, #475569 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 11px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 28px;
}

button {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

button:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

button:disabled {
  border-color: var(--line);
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

button:active {
  transform: translateY(1px);
}

.small-button,
.icon-button,
.icon-tool-button {
  width: auto;
  height: auto;
  min-height: 28px;
  line-height: 1;
  padding: 7px 9px;
  font-size: 12px;
}

.icon-button,
.icon-tool-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.icon-tool-button {
  border-color: var(--line);
  background: #ffffff;
  color: #475569;
  font-size: 15px;
}

.icon-tool-button:hover {
  border-color: var(--teal);
  background: #f4fbfa;
  color: var(--teal);
}

.danger {
  border-color: #f2c2bb;
  background: var(--red-soft);
  color: var(--red);
}

.sniper-freeze-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid #cfe5df;
  border-radius: 8px;
  background: #f5fbf9;
  padding: 16px;
}

.sniper-freeze-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sniper-freeze-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 20px;
}

.sniper-freeze-card p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.sniper-freeze-card .small-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  padding: 0 13px;
  text-decoration: none;
  font-weight: 700;
}

.sniper-frame {
  width: 100%;
  min-height: min(760px, calc(100vh - 190px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.network-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 16px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(237, 242, 249, 0.94);
  padding: 5px;
}

.network-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.network-tabs button:hover {
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}

.network-tabs button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(42, 80, 140, 0.08);
}

.flow {
  display: grid;
  gap: 14px;
}

.flow-step {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.step-label {
  position: sticky;
  top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(320px, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.form-card,
.project-card,
.source-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.form-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 200px 168px;
  gap: 10px;
  align-items: end;
}

.form-card h3 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

#contractForm {
  grid-template-columns: 220px 190px minmax(320px, 1fr) 180px;
}

.project-network-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(237, 242, 249, 0.94);
  padding: 5px;
}

.project-network-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.project-network-tabs button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.08);
}

.project-workbench {
  display: grid;
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr) minmax(240px, 285px);
  gap: 12px;
  align-items: start;
}

.project-column,
.token-column,
.collection-column {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.project-create-card,
.token-add-card,
.collection-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  padding: 12px;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.035);
}

.project-create-card,
.token-add-card {
  display: grid;
  gap: 9px;
}

.project-create-card h3,
.token-add-card h3,
.collection-card h3 {
  margin-bottom: 0;
}

#contractForm.token-add-card {
  grid-template-columns: minmax(170px, 1fr) minmax(130px, 0.7fr);
  align-items: end;
}

#contractForm.token-add-card h3 {
  grid-column: 1 / -1;
}

#contractForm.token-add-card label:nth-of-type(3),
#contractForm.token-add-card button {
  grid-column: 1 / -1;
}

.token-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

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

.workbench-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-list-card {
  cursor: default;
  padding: 10px;
}

.project-list-card.is-selected {
  border-color: rgba(45, 123, 115, 0.42);
  box-shadow: 0 0 0 3px rgba(45, 123, 115, 0.08);
}

.project-list-card header {
  margin-bottom: 9px;
}

.project-list-card h3 {
  font-size: 16px;
}

.project-list-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.project-list-meta span {
  min-width: 0;
  border-radius: 8px;
  background: #f4f7fb;
  padding: 7px;
}

.project-list-meta small,
.project-list-meta b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-meta small {
  color: #8a96a8;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-list-meta b {
  margin-top: 2px;
  color: #334155;
  font-size: 12px;
}

.compact-contract-list .contract-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.compact-contract-list .contract-stats {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-contract-list .contract-actions {
  width: 104px;
}

.collection-card {
  position: sticky;
  top: 16px;
}

.collection-status {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.collection-status p {
  margin: 7px 0 0;
  font-size: 12px;
}

.collection-card .holder-summary,
.collection-card .project-settings {
  grid-template-columns: 1fr;
}

.collection-card .holder-summary strong {
  font-size: 18px;
}

.collection-card .project-settings {
  margin-bottom: 10px;
}

.collection-card .check {
  padding: 4px 7px;
  font-size: 11px;
}

.collection-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.collection-actions .danger:last-child {
  grid-column: 1 / -1;
}

.watchlist-details {
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.watchlist-details summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
}

.watchlist-panel {
  border-top: 1px solid var(--line);
  padding: 10px;
}

.watchlist-table {
  display: grid;
  gap: 6px;
}

.watchlist-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.55fr) minmax(160px, 1fr) minmax(110px, 0.8fr) minmax(120px, 0.8fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 12px;
}

.watchlist-row code,
.watchlist-row span,
.watchlist-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-button.ghost {
  background: #eef2f7;
  color: #475569;
}

.project-board {
  display: grid;
  gap: 12px;
}

.project-card header,
.source-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.project-actions,
.contract-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.contract-actions {
  width: 116px;
}

.contract-actions .small-button {
  flex: 1 1 auto;
}

.project-settings {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.project-settings input[type="number"] {
  height: 38px;
  line-height: 36px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  align-items: center;
}

.filter-prefix {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  margin-right: 2px;
}

.check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #eef2f7;
  padding: 4px 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.check input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.period-checks {
  align-self: stretch;
}

.period-checks .check {
  margin: 0 6px 6px 0;
}

.contract-address-line {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
}

.contract-address-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.contract-address-line code {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.project-card header {
  margin-bottom: 12px;
}

.project-card.is-waiting .holder-summary {
  border-style: dashed;
}

.project-card.is-paused {
  background: #f8fafc;
}

.project-card.is-paused .holder-summary,
.project-card.is-paused .project-settings,
.project-card.is-paused .contract-row {
  opacity: 0.72;
}

.project-card h3,
.source-card h3 {
  margin-bottom: 3px;
}

.holder-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.holder-summary div {
  min-width: 0;
}

.holder-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.holder-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.holder-summary p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}

.contract-list {
  display: grid;
  gap: 6px;
}

.contract-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(560px, 1.85fr) 116px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.contract-stats {
  display: grid;
  grid-template-columns: minmax(112px, 1.1fr) minmax(128px, 1.15fr) minmax(58px, 0.65fr) minmax(78px, 0.8fr) minmax(94px, 0.9fr);
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.contract-stats span {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 38px;
  border-left: 1px solid #e6edf5;
  padding: 2px 8px;
  color: #475569;
  line-height: 1.25;
}

.contract-stats small {
  overflow: hidden;
  color: #8a96a8;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.contract-stats b {
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.section-head-inline h3 {
  margin: 0;
}

.section-head-inline select {
  width: 180px;
}

#tsunami .section-head-inline {
  margin-top: 2px;
  margin-bottom: 12px;
}

#tsunami .section-head-inline .small-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
}

.analytics-board {
  min-width: 0;
}

.analytics-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.analytics-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.analytics-table th {
  background: #f8fafc;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.analytics-table td strong,
.analytics-table td span,
.analytics-table td small {
  display: block;
}

.analytics-table td span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-table td small {
  margin-top: 3px;
  color: #7b8798;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.token-cell {
  min-width: 150px;
}

.analytics-table .num {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.metric-cell {
  display: grid;
  gap: 2px;
  min-width: 136px;
}

.metric-cell b {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.metric-cell span {
  margin-top: 0;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.84;
  white-space: nowrap;
}

.price-context {
  display: grid;
  gap: 2px;
  min-width: 126px;
}

.price-context b {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.price-context span {
  margin-top: 0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.price-context small {
  margin-top: 0;
  max-width: 150px;
  white-space: normal;
}

.portfolio-share-cell {
  display: grid;
  gap: 2px;
  min-width: 142px;
}

.portfolio-share-cell b {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.portfolio-share-cell span {
  margin-top: 0;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.portfolio-share-cell small {
  margin-top: 0;
  color: var(--muted);
}

.flow-composition {
  display: grid;
  gap: 2px;
  min-width: 150px;
}

.flow-composition details {
  position: relative;
}

.flow-composition summary {
  display: grid;
  gap: 2px;
  cursor: pointer;
  list-style: none;
}

.flow-composition summary::-webkit-details-marker {
  display: none;
}

.flow-composition span,
.flow-composition b {
  margin-top: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.flow-composition small {
  color: var(--muted);
  font-weight: 700;
}

.flow-details {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) auto;
  gap: 4px 10px;
  margin-top: 7px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.flow-details b {
  color: var(--muted);
}

.analytics-table mark {
  min-width: 0;
  white-space: nowrap;
}

.trend-board {
  min-width: 0;
}

.trend-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.trend-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.trend-card header strong,
.trend-card header span {
  display: block;
}

.trend-card header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.trend-chart {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: 220px;
}

.trend-grid line {
  stroke: #dfe6ef;
  stroke-width: 1;
}

.trend-lines path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.trend-lines .price-line {
  stroke-width: 2;
  stroke-dasharray: 7 6;
  opacity: 0.9;
}

.trend-chart text {
  fill: #667085;
  font-size: 12px;
  font-weight: 800;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.trend-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border-radius: 999px;
  background: #f3f6f8;
  padding: 5px 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.trend-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.trend-legend .price-dot {
  border: 2px solid #64748b;
  background: transparent;
}

.trend-card p {
  margin: 0;
  font-size: 13px;
}

.signal-board {
  display: grid;
  gap: 10px;
}

.signal-summary-card,
.signal-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.signal-summary-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.signal-summary-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.signal-summary-card span,
.signal-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.signal-summary-card strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
}

.signal-summary-card p,
.signal-row p {
  margin: 4px 0 0;
  font-size: 13px;
}

.signal-list {
  display: grid;
  gap: 6px;
}

.operation-classification-card {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfefe;
  padding: 12px;
}

.operation-classification-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.operation-classification-card header span,
.operation-classification-card p {
  color: var(--muted);
  font-size: 12px;
}

.operation-category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.operation-category-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
}

.operation-category-list b,
.operation-category-list small {
  display: block;
}

.operation-category-list b {
  font-size: 12px;
}

.operation-category-list small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.signal-row {
  display: grid;
  gap: 10px;
}

.signal-row-main {
  display: grid;
  grid-template-columns: minmax(100px, 0.9fr) minmax(120px, 150px) minmax(82px, 96px) minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 10px 14px;
  align-items: start;
  min-width: 0;
}

.signal-row strong,
.signal-row span {
  display: block;
  min-width: 0;
}

.signal-token-cell {
  min-width: 0;
}

.signal-token-cell strong {
  font-size: 15px;
}

.signal-row-main > p {
  grid-column: 1 / -1;
  margin: 0;
  max-width: none;
  line-height: 1.45;
}

.signal-conclusion {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--ink);
}

.signal-conclusion b {
  display: inline;
}

.signal-price-context {
  display: block;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
}

.signal-price-context span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.signal-price-context b {
  font-size: 14px;
  white-space: nowrap;
}

.signal-quality {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.signal-quality b {
  font-size: 14px;
  white-space: nowrap;
}

.signal-quality span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.operation-inline-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 700;
}

.signal-strength {
  white-space: normal;
  padding-top: 7px;
}

.tsunami-settings,
.tsunami-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.tsunami-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.tsunami-settings h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(18, 25, 38, 0.42);
  padding: 24px;
}

.modal-backdrop.is-hidden {
  display: none;
}

.modal {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(18, 25, 38, 0.28);
}

.modal .tsunami-settings {
  border: 0;
  background: #ffffff;
}

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

.modal-head h3 {
  margin-bottom: 5px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.signal-settings-modal {
  width: min(1080px, 100%);
}

.signal-rule-list {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
}

.signal-rule-list.custom {
  padding-top: 0;
}

.signal-rule {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(190px, 0.95fr) minmax(220px, 1.05fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.signal-rule.is-locked {
  background: #fbfcfe;
}

.signal-rule strong,
.signal-rule span,
.signal-rule small,
.signal-rule b {
  display: block;
}

.signal-rule strong {
  font-size: 14px;
}

.signal-rule span,
.signal-rule small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.signal-rule b {
  margin-top: 3px;
  color: #334155;
  font-size: 12px;
}

.signal-rule p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.signal-custom-form {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(160px, 0.8fr) repeat(3, minmax(130px, 0.7fr)) 150px;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 14px 16px;
}

.signal-custom-form h3 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.tsunami-form-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  justify-content: flex-start;
}

.slow-collector {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 260px) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  padding: 12px 12px;
  box-shadow: 0 8px 20px rgba(31, 41, 55, 0.035);
}

.slow-collector strong,
.slow-collector span {
  display: block;
}

.slow-collector strong {
  color: #334155;
  font-size: 15px;
}

.slow-collector.is-running strong {
  color: var(--teal);
}

.slow-collector span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: pre-line;
}

.slow-progress {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e8eef5;
}

.slow-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #94a3b8;
  transition: width 0.35s ease;
}

.slow-collector.is-running .slow-progress i {
  background: var(--teal);
  animation: pulseProgress 1.4s ease-in-out infinite;
}

@keyframes pulseProgress {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

.tsunami-sensors {
  display: grid;
  gap: 9px;
}

.tsunami-sensor {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(0, 1.8fr) minmax(82px, auto) minmax(180px, auto);
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  padding: 10px 10px;
  box-shadow: 0 6px 16px rgba(31, 41, 55, 0.03);
}

.tsunami-sensor strong,
.tsunami-sensor span {
  display: block;
}

.tsunami-sensor span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tsunami-sensor > div:first-child {
  min-width: 0;
}

.tsunami-sensor > div:first-child strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tsunami-sensor-rules {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.75fr) minmax(0, 0.75fr) minmax(0, 0.75fr) minmax(0, 0.95fr);
  gap: 6px;
  min-width: 0;
}

.tsunami-sensor-rules span {
  display: grid;
  align-content: center;
  margin: 0;
  min-height: 38px;
  min-width: 0;
  border-left: 1px solid #e6edf5;
  padding: 2px 8px;
  color: #475569;
}

.tsunami-sensor-rules small {
  overflow: hidden;
  color: #8a96a8;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tsunami-sensor-rules b {
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tsunami-status {
  justify-self: start;
  min-width: 82px;
  white-space: nowrap;
}

.tsunami-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.tsunami-example span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.tsunami-empty p {
  margin: 5px 0 0;
  font-size: 13px;
}

.tsunami-alerts {
  display: grid;
  gap: 12px;
  margin-top: 2px;
}

.tsunami-empty {
  display: grid;
  gap: 10px;
}

.tsunami-empty > strong {
  font-size: 18px;
}

.tsunami-example {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.tsunami-example b {
  display: block;
  margin-top: 4px;
}

.positive {
  color: var(--teal);
}

.negative {
  color: var(--red);
}

.neutral {
  color: var(--muted);
}

mark.positive {
  background: var(--green-soft);
  color: var(--teal);
}

mark.negative {
  background: var(--red-soft);
  color: var(--red);
}

mark.neutral {
  background: #eef2f7;
  color: #475569;
}

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

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

.operation-group h3 {
  margin: 0;
  color: var(--teal);
  font-size: 15px;
}

.operation-row {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(120px, 160px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.operation-row strong {
  display: block;
  margin-bottom: 4px;
}

.operation-row code {
  color: var(--muted);
  font-size: 12px;
}

.operation-row span {
  border-radius: 999px;
  background: #f3f6f8;
  padding: 5px 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.operation-row p {
  margin: 0;
  font-size: 13px;
}

.token-main {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
}

.token-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

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

.token-main strong {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  line-height: 1.1;
}

.token-main em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f1f5f9;
  padding: 3px 7px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.token-main span {
  display: block;
  margin-top: 2px;
  color: #475569;
  font-size: 13px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

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

.summary article,
.signal-card,
.warning-item,
.cluster,
.pipeline article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.summary span,
.signal-card span,
.warning-item span,
.cluster span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 28px;
}

.summary p {
  margin: 4px 0 0;
  font-size: 13px;
}

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

.signal-card {
  display: grid;
  gap: 12px;
}

.signal-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.signal-card h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.score {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--teal);
  font-weight: 700;
}

.score.is-risk {
  background: var(--red-soft);
  color: var(--red);
}

.score.is-watch {
  background: var(--amber-soft);
  color: var(--amber);
}

.meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.chip.good {
  background: var(--green-soft);
  color: var(--teal);
}

.chip.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.bad {
  background: var(--red-soft);
  color: var(--red);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #4b5563;
  font-size: 12px;
  text-transform: uppercase;
}

td strong {
  display: block;
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

mark {
  display: inline-block;
  min-width: 74px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f7;
  color: var(--ink);
  text-align: center;
  font-weight: 700;
}

mark.good {
  background: var(--green-soft);
  color: var(--teal);
}

mark.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

mark.bad {
  background: var(--red-soft);
  color: var(--red);
}

.warning-list,
.cluster-map,
.pipeline,
.source-grid,
.baseline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.baseline-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.baseline-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.baseline-card h3 {
  margin-bottom: 0;
  font-size: 22px;
}

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

.baseline-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.baseline-metrics small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.baseline-metrics b {
  display: block;
  margin-top: 4px;
  font-size: 19px;
}

.muted-card {
  border-style: dashed;
}

.api-error {
  border: 1px solid #f2c2bb;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  padding: 12px;
}

.api-error strong {
  display: block;
  margin-bottom: 6px;
}

.api-error p {
  margin: 0;
  color: var(--red);
}

.source-card {
  display: grid;
  gap: 10px;
}

.source-card p {
  margin-bottom: 0;
}

.source-meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.source-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.source-meta b {
  text-align: right;
}

.warning-item {
  display: grid;
  gap: 8px;
}

.warning-item strong {
  font-size: 20px;
}

.cluster {
  min-height: 164px;
}

.cluster b {
  display: block;
  margin: 8px 0;
  font-size: 17px;
}

.cluster-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
}

.dot.blue {
  background: var(--blue);
}

.dot.amber {
  background: var(--amber);
}

.dot.red {
  background: var(--red);
}

.pipeline article span {
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
}

.pipeline article p {
  margin-bottom: 0;
}

@media (max-width: 1050px) {
  .project-workbench {
    grid-template-columns: minmax(240px, 0.9fr) minmax(360px, 1.1fr);
  }

  .collection-column {
    grid-column: 1 / -1;
  }

  .collection-card {
    position: static;
  }

  #contractForm.token-add-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #contractForm.token-add-card button {
    grid-column: 1 / -1;
  }

  .form-card,
  #contractForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-card button,
  #contractForm button {
    grid-column: 1 / -1;
  }

  .contract-row {
    grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.4fr);
  }

  .compact-contract-list .contract-row {
    grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.2fr);
  }

  .contract-actions {
    grid-column: 1 / -1;
    width: auto;
    justify-content: flex-start;
  }

  .tsunami-sensor {
    grid-template-columns: minmax(210px, 1fr) minmax(300px, 1.3fr);
  }

  .signal-rule,
  .signal-custom-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slow-collector {
    grid-template-columns: 1fr;
  }

  .tsunami-status,
  .tsunami-actions {
    grid-column: 1 / -1;
  }

  .tsunami-actions {
    width: auto;
    justify-content: flex-start;
  }

  .signal-grid,
  .summary,
  .warning-list,
  .cluster-map,
  .pipeline,
  .source-grid,
  .baseline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    width: 100%;
    max-width: 100vw;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    overflow-x: clip;
  }

  .side {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: min(284px, calc(100vw - 44px));
    min-height: 100vh;
    min-height: 100dvh;
    padding: 18px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 22px 0 50px rgba(17, 26, 36, 0.24);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .mobile-nav-open .side {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-open {
    overflow: hidden;
  }

  .workspace {
    min-width: 0;
    max-width: 100%;
    padding: 12px 12px 24px;
    overflow-x: clip;
  }

  .brand {
    display: flex;
    justify-items: stretch;
    gap: 12px;
    margin: 0 38px 22px 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand > div:last-child {
    display: block;
  }

  .nav {
    gap: 8px;
  }

  .nav a {
    display: block;
    min-height: 0;
    padding: 12px;
    font-size: 15px;
    line-height: 1.2;
    text-align: left;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 0;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
  }

  .mobile-nav-toggle span + span {
    margin-top: 0;
  }

  .mobile-nav-close {
    position: absolute;
    top: 16px;
    right: 14px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(203, 213, 225, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    padding: 0;
    font-size: 24px;
    line-height: 1;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: -12px -12px 12px;
    border-bottom: 1px solid rgba(215, 225, 234, 0.9);
    background: rgba(248, 251, 252, 0.96);
    padding: 10px 12px;
    backdrop-filter: blur(12px);
  }

  .topbar > div:first-of-type {
    min-width: 0;
  }

  .topbar .eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .panel-head {
    display: block;
  }

  .topbar h1 {
    margin-bottom: 5px;
  }

  .status {
    grid-column: 1 / -1;
    margin-top: 12px;
    min-width: 0;
    padding: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .status span {
    grid-column: 1 / -1;
  }

  .status strong {
    font-size: 17px;
  }

  .logout-button {
    height: 34px;
    line-height: 32px;
  }

  .panel {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    overflow: hidden;
  }

  .panel-head {
    margin-bottom: 12px;
  }

  .panel-head p,
  .lead {
    font-size: 13px;
    line-height: 1.42;
  }

  .controls,
  .project-layout,
  .project-workbench,
  .project-network-tabs,
  .token-add-card,
  .tsunami-settings,
  .tsunami-sensor,
  .signal-rule,
  .signal-custom-form,
  .flow-step,
  .project-settings,
  .form-card,
  #contractForm,
  .sniper-freeze-card,
  .holder-summary,
  .signal-grid,
  .summary,
  .warning-list,
  .cluster-map,
  .pipeline,
  .source-grid,
  .baseline-grid {
    grid-template-columns: 1fr;
  }

  .flow {
    gap: 12px;
    min-width: 0;
  }

  .flow-step {
    gap: 8px;
    min-width: 0;
  }

  .flow-step > div,
  .flow-step > form {
    min-width: 0;
  }

  .step-label {
    position: static;
    justify-self: start;
    width: max-content;
    min-width: 62px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .form-card,
  #contractForm {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 9px;
    padding: 10px;
  }

  .project-network-tabs {
    gap: 5px;
  }

  .project-network-tabs button {
    min-height: 36px;
    font-size: 12px;
  }

  #contractForm.token-add-card button,
  .collection-actions .danger:last-child {
    grid-column: auto;
  }

  .collection-actions {
    grid-template-columns: 1fr;
  }

  .watchlist-row {
    grid-template-columns: 1fr;
  }

  .form-card h3,
  #contractForm h3 {
    font-size: 18px;
    line-height: 1.2;
  }

  label {
    gap: 6px;
    font-size: 12px;
  }

  legend {
    font-size: 12px;
  }

  .period-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .period-checks legend {
    flex: 0 0 100%;
    margin-bottom: 0;
  }

  .period-checks .check {
    margin: 0;
  }

  select,
  input,
  button {
    min-width: 0;
    height: 40px;
    line-height: 38px;
    font-size: 13px;
  }

  .project-card header,
  .contract-row,
  .operation-row,
  .signal-summary-card,
  .signal-row {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .project-actions,
  .contract-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .project-actions .small-button,
  .contract-actions .small-button {
    min-width: 0;
  }

  .project-card,
  .source-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 10px;
    overflow: hidden;
  }

  .project-settings {
    width: 100%;
    min-width: 0;
    padding: 9px;
  }

  .holder-summary {
    width: 100%;
    min-width: 0;
    gap: 7px;
  }

  .holder-summary strong {
    font-size: 18px;
  }

  .contract-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 9px;
    padding: 9px;
  }

  .contract-stats {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .contract-stats span {
    min-height: 34px;
    border-left: 0;
    border-top: 1px solid #e6edf5;
    padding: 6px 0 0;
  }

  .tsunami-sensor-rules {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .section-head-inline {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }

  .section-head-inline select {
    width: 100%;
  }

  .analytics-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .analytics-table {
    display: grid;
    min-width: 0;
    border-collapse: separate;
    gap: 10px;
  }

  .analytics-table thead {
    display: none;
  }

  .analytics-table tbody {
    display: grid;
    gap: 10px;
  }

  .analytics-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
  }

  .analytics-table tr:last-child td {
    border-bottom: 1px solid var(--line);
  }

  .analytics-table tr:last-child td:last-child,
  .analytics-table td:last-child {
    border-bottom: 0;
  }

  .analytics-table td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
    padding: 10px 12px;
    font-size: 12px;
  }

  .analytics-table td::before {
    content: attr(data-label);
    color: #667085;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
  }

  .analytics-table td[data-label="Токен"] {
    grid-template-columns: 1fr;
    align-items: center;
    background: #f8fafc;
  }

  .analytics-table td[data-label="Токен"]::before {
    content: "";
    display: none;
  }

  .token-cell,
  .metric-cell,
  .price-context,
  .portfolio-share-cell,
  .flow-composition {
    min-width: 0;
  }

  .token-cell strong {
    font-size: 16px;
  }

  .metric-cell b,
  .price-context b,
  .portfolio-share-cell b {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .metric-cell span,
  .price-context span,
  .portfolio-share-cell span,
  .analytics-table td small {
    white-space: normal;
  }

  .flow-composition summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .flow-composition summary small {
    grid-column: 1 / -1;
  }

  .flow-composition span,
  .flow-composition b {
    white-space: normal;
  }

  .flow-details {
    grid-template-columns: 1fr;
  }

  .sniper-freeze-card {
    align-items: flex-start;
  }

  .sniper-freeze-card .small-button {
    width: 100%;
  }

  .sniper-frame {
    min-height: 680px;
  }

  .project-board,
  .contract-list,
  .signal-board,
  .signal-list,
  .signal-row,
  .signal-row-main,
  .trend-board,
  .analytics-board,
  .operation-classification-card,
  .operation-category-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .project-actions,
  .contract-actions,
  .filter-row {
    flex-wrap: wrap;
  }

  .project-actions .small-button,
  .contract-actions .small-button {
    flex: 1 1 96px;
  }

  .operation-classification-card header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .operation-classification-card mark {
    justify-self: start;
  }

  .operation-category-list {
    grid-template-columns: 1fr;
  }

  .signal-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .signal-summary-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }

  .signal-summary-actions mark,
  .signal-summary-actions .small-button {
    width: 100%;
    justify-content: center;
  }

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

  .signal-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 10px;
    overflow: hidden;
  }

  .signal-row-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .signal-token-cell {
    display: grid;
    gap: 2px;
  }

  .signal-token-cell strong {
    font-size: 18px;
  }

  .signal-row-main > mark {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }

  .signal-strength {
    padding-top: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .signal-price-context,
  .signal-quality {
    display: grid;
    gap: 2px;
    justify-self: stretch;
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }

  .signal-price-context b,
  .signal-quality b {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .signal-row-main > p {
    border-top: 1px solid var(--line);
    padding-top: 8px;
    font-size: 13px;
  }

  .signal-conclusion {
    font-size: 13px;
  }

  .operation-classification-card {
    margin-top: 8px;
    padding: 10px;
  }

  .operation-classification-card header {
    gap: 8px;
  }

  .operation-category-list span {
    min-width: 0;
  }

  h1 {
    font-size: 26px;
    line-height: 1.12;
  }
}

@media (max-width: 420px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    width: min(282px, calc(100vw - 34px));
    padding-inline: 14px;
  }

  .workspace {
    padding-inline: 10px;
  }

  .topbar {
    margin-inline: -10px;
    padding-inline: 10px;
  }

  .panel {
    padding: 9px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 19px;
  }

  .analytics-table td {
    grid-template-columns: minmax(82px, 32%) minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  .signal-row,
  .signal-summary-card,
  .operation-classification-card {
    padding: 9px;
  }

  .signal-token-cell strong {
    font-size: 17px;
  }
}
