:root {
  --brand: #21c161;
  --brand-strong: #118342;
  --brand-deep: #086232;
  --brand-soft: rgba(33, 193, 97, 0.13);
  --brand-faint: rgba(33, 193, 97, 0.07);
  --white: #ffffff;
  --bg: #f3faf6;
  --bg-soft: #eaf6f0;
  --ink: #102018;
  --ink-soft: #294338;
  --muted: #668074;
  --muted-strong: #496458;
  --line: rgba(17, 131, 66, 0.18);
  --line-strong: rgba(33, 193, 97, 0.42);
  --glass-line: rgba(255, 255, 255, 0.76);
  --surface: rgba(255, 255, 255, 0.66);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.48);
  --cyan: #0891b2;
  --blue: #2563eb;
  --amber: #a16207;
  --red: #dc2626;
  --shadow: 0 24px 70px rgba(16, 50, 34, 0.14);
  --shadow-soft: 0 14px 34px rgba(16, 50, 34, 0.1);
  --shadow-glow: 0 18px 44px rgba(33, 193, 97, 0.24);
  --ring: 0 0 0 4px rgba(33, 193, 97, 0.2);
  --radius: 8px;
  --header-height: 76px;
  --ease: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(238, 249, 243, 0.96) 48%, rgba(232, 245, 241, 0.96) 100%),
    linear-gradient(125deg, rgba(33, 193, 97, 0.12), rgba(8, 145, 178, 0.08) 52%, rgba(255, 255, 255, 0.84));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(17, 131, 66, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 131, 66, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 80%);
  content: "";
  pointer-events: none;
}

body.mobile-menu-open,
body.dialog-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none !important;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

code,
.wallet-address,
.order-item code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.mesh {
  position: absolute;
  display: block;
  opacity: 0.72;
  transform: translate3d(0, 0, 0);
}

.mesh-a {
  top: 0;
  left: 0;
  width: 100%;
  height: 260px;
  background: linear-gradient(110deg, rgba(33, 193, 97, 0.16), rgba(255, 255, 255, 0) 62%);
}

.mesh-b {
  right: 0;
  bottom: 0;
  width: 100%;
  height: 360px;
  background: linear-gradient(315deg, rgba(8, 145, 178, 0.1), rgba(255, 255, 255, 0) 58%);
}

.mesh-c {
  inset: 16% 8% auto;
  height: 190px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(33, 193, 97, 0.08), rgba(255, 255, 255, 0));
  filter: blur(18px);
}

.grid-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 62%);
}

.app-shell {
  display: grid;
  grid-template-areas:
    "header"
    "workspace";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  width: min(100%, 1480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 30;
  grid-area: header;
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) auto minmax(250px, 0.9fr);
  align-items: center;
  gap: 16px;
  min-height: var(--header-height);
  padding: 12px 16px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 48px;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(220, 255, 235, 0.78)),
    linear-gradient(45deg, rgba(33, 193, 97, 0.18), transparent);
  box-shadow: 0 14px 30px rgba(33, 193, 97, 0.19);
}

.brand-mark img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand h1,
.brand h2,
.brand p,
.view-head h2,
.view-head p,
.panel-heading h2,
.panel-heading h3,
.panel-heading p,
.command-center h2,
.command-center p {
  margin: 0;
}

.brand h1 {
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand h2 {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand p,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.desktop-nav {
  justify-self: center;
}

.tabs,
.segmented {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tab-button,
.segment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: var(--muted-strong);
  background: transparent;
  font-weight: 840;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), color var(--ease);
}

.tab-button:hover,
.segment-button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  transform: translateY(-1px);
}

.tab-button:active,
.segment-button:active {
  transform: scale(0.98);
}

.tab-button.active,
.segment-button.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  box-shadow: 0 12px 28px rgba(33, 193, 97, 0.24);
}

.wallet-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.header-wallet {
  justify-self: end;
  padding: 6px;
  border: 1px solid rgba(17, 131, 66, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.34);
}

.wallet-address {
  display: none;
  overflow: hidden;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(33, 193, 97, 0.24);
  border-radius: 6px;
  color: var(--brand-deep);
  background: rgba(220, 252, 231, 0.84);
  font-size: 12px;
  font-weight: 880;
}

.wallet-button {
  min-width: 118px;
  max-width: 176px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-button.loading {
  position: relative;
  padding-right: 36px;
}

.wallet-button.loading::after {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: wallet-spin 780ms linear infinite;
}

.wallet-button.connected {
  color: var(--brand-deep);
  border-color: rgba(33, 193, 97, 0.42);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 26px rgba(33, 193, 97, 0.16);
}

.external-nav-button {
  border-color: rgba(8, 145, 178, 0.18);
  color: #075f75;
}

.external-nav-button:hover {
  color: #064e61;
}

@keyframes wallet-spin {
  to {
    transform: rotate(360deg);
  }
}

.menu-button {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.menu-button span + span {
  margin-top: 5px;
}

.mobile-scrim,
.mobile-drawer {
  display: none;
}

.workspace {
  grid-area: workspace;
  min-width: 0;
  min-height: 0;
  padding: 2px 0 30px;
}

.command-center {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "copy"
    "metrics";
  gap: 20px;
  min-height: 220px;
  margin-bottom: 18px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.62)),
    linear-gradient(105deg, rgba(33, 193, 97, 0.16), rgba(8, 145, 178, 0.08) 54%, rgba(255, 255, 255, 0.7));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.command-center::before {
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(33, 193, 97, 0.78);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.3), transparent 38%),
    repeating-linear-gradient(90deg, rgba(17, 131, 66, 0.045) 0 1px, transparent 1px 72px);
  content: "";
  pointer-events: none;
}

.command-center > * {
  position: relative;
}

.command-copy {
  grid-area: copy;
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.command-copy h2 {
  color: var(--ink);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  line-height: 1.08;
}

.command-subtitle {
  max-width: 680px;
  overflow-wrap: anywhere;
  color: var(--muted-strong);
  font-size: 16px;
  font-weight: 760;
}

.metric-grid {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 106px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.metric-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
  content: "";
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.metric-card strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.tool-head {
  min-height: 64px;
  padding: 0 2px;
}

.view-head h2 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 880;
  line-height: 1.22;
}

.tool-actions,
.card-actions,
.button-row,
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-actions {
  justify-content: flex-end;
}

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

.material-list-panel,
.settings-panel,
.billing-panel,
.order-panel,
.plan-card,
.material-card,
.dialog-panel {
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.material-list-panel,
.settings-panel,
.billing-panel,
.order-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading.compact {
  align-items: flex-start;
}

.panel-heading h2,
.panel-heading h3,
.order-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(280px, 0.35fr);
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.field-label,
.form-field span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
}

.field-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.text-input,
.text-area,
.file-input {
  width: 100%;
  border: 1px solid rgba(17, 131, 66, 0.24);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease), transform var(--ease);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.text-input,
.file-input {
  height: 46px;
  padding: 0 13px;
}

.file-input {
  padding-top: 10px;
}

.text-area {
  min-height: 190px;
  resize: vertical;
  padding: 12px 13px;
}

.text-input::placeholder,
.text-area::placeholder {
  color: rgba(73, 100, 88, 0.72);
}

.text-input:hover,
.text-area:hover,
.file-input:hover {
  border-color: rgba(33, 193, 97, 0.48);
  background: rgba(255, 255, 255, 0.82);
}

.text-input:focus,
.text-area:focus,
.file-input:focus {
  border-color: rgba(33, 193, 97, 0.78);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.text-input:read-only {
  color: var(--muted);
  background: rgba(238, 246, 241, 0.72);
  cursor: default;
}

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

.material-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) minmax(260px, 1fr) minmax(190px, 0.74fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 12px 14px 12px 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.58);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease), background var(--ease);
}

.material-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
  content: "";
}

.material-card:hover {
  border-color: rgba(33, 193, 97, 0.42);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.material-card.disabled {
  opacity: 0.68;
}

.material-card.disabled::before {
  background: rgba(102, 128, 116, 0.42);
}

.material-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.material-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.material-card h3 {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 860;
  line-height: 1.35;
}

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

.material-preview {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted-strong);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.material-attachment {
  min-width: 0;
}

.file-badge,
.file-meta {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.file-badge {
  display: grid;
  max-width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.file-badge span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.file-badge strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-badge.muted {
  display: inline-flex;
  align-items: center;
  color: rgba(102, 128, 116, 0.78);
}

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

.keyword-chip,
.status-pill,
.plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(33, 193, 97, 0.22);
  border-radius: 6px;
  color: var(--brand-deep);
  background: rgba(218, 250, 230, 0.78);
  font-size: 12px;
  font-weight: 850;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.status-pill {
  color: #7c5207;
  border-color: rgba(161, 98, 7, 0.22);
  background: rgba(254, 243, 199, 0.82);
  white-space: nowrap;
}

.status-pill.success {
  color: var(--brand-deep);
  border-color: rgba(33, 193, 97, 0.24);
  background: rgba(220, 252, 231, 0.84);
}

.status-pill.info {
  color: #164c8a;
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(221, 235, 255, 0.82);
}

.status-pill.muted {
  color: #53675e;
  border-color: rgba(83, 103, 94, 0.18);
  background: rgba(243, 247, 245, 0.8);
}

.material-card .card-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.primary-button,
.secondary-button,
.danger-button,
.square-button,
.small-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 850;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease), border-color var(--ease), color var(--ease);
}

.primary-button {
  min-height: 44px;
  padding: 0 16px;
  color: var(--white);
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  box-shadow: var(--shadow-glow);
}

.material-form .primary-button[type="submit"] {
  min-width: 108px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-strong));
  box-shadow: 0 22px 46px rgba(33, 193, 97, 0.3);
  transform: translateY(-2px);
}

.secondary-button,
.small-button,
.icon-button {
  min-height: 42px;
  padding: 0 13px;
  color: var(--ink);
  border-color: rgba(17, 131, 66, 0.22);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.secondary-button:hover,
.small-button:hover,
.icon-button:hover {
  border-color: rgba(33, 193, 97, 0.46);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 28px rgba(16, 50, 34, 0.1);
  transform: translateY(-1px);
}

.icon-button {
  min-width: 54px;
  min-height: 38px;
  padding: 0 11px;
  font-size: 13px;
}

.edit-button {
  color: var(--brand-deep);
  border-color: rgba(33, 193, 97, 0.34);
}

.danger-button,
.danger-icon {
  min-height: 42px;
  padding: 0 13px;
  color: var(--white);
  background: linear-gradient(135deg, var(--red), #ef4444);
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.18);
}

.danger-button:hover,
.danger-icon:hover {
  border-color: rgba(220, 38, 38, 0.36);
  background: linear-gradient(135deg, #b91c1c, var(--red));
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.small-button:active,
.danger-button:active,
.square-button:active,
.icon-button:active {
  transform: scale(0.98);
}

.square-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--white);
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  box-shadow: var(--shadow-glow);
}

.material-form,
.form-grid,
.group-form {
  display: grid;
  gap: 14px;
}

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

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

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

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

.file-meta {
  min-width: 0;
}

.file-meta.has-file {
  color: var(--brand-deep);
  font-weight: 750;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink-soft);
  font-weight: 850;
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}

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

.billing-panel,
.order-panel {
  min-height: 100%;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.plan-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 218px;
  overflow: hidden;
  padding: 18px;
  background: rgba(255, 255, 255, 0.58);
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease), background var(--ease);
}

.plan-card::before {
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(33, 193, 97, 0.72);
  background:
    linear-gradient(135deg, rgba(33, 193, 97, 0.14), transparent 48%),
    linear-gradient(315deg, rgba(8, 145, 178, 0.1), transparent 58%);
  content: "";
  pointer-events: none;
}

.plan-card:hover {
  border-color: rgba(33, 193, 97, 0.42);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.plan-card > * {
  position: relative;
}

.plan-card.trial-plan {
  border-color: rgba(33, 193, 97, 0.36);
}

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

.plan-card h3,
.plan-card p {
  margin: 0;
}

.plan-card h3 {
  color: var(--ink);
  font-size: 19px;
  font-weight: 880;
}

.plan-badge {
  min-width: 48px;
  color: var(--brand-deep);
}

.price-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.original-price {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
}

.price-line strong {
  color: var(--ink);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 930;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.price-line span,
.plan-desc {
  color: var(--muted);
  font-weight: 720;
}

.plan-card .primary-button {
  align-self: end;
  width: 100%;
}

.plan-grid > .empty-state {
  grid-column: 1 / -1;
}

.order-panel {
  display: grid;
  gap: 12px;
}

.order-panel-head {
  display: grid;
  gap: 2px;
}

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

.order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.order-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

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

.order-actions {
  justify-content: flex-end;
}

.order-item code {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

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

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

.segmented {
  width: 100%;
}

.segment-button {
  flex: 1;
}

.mode-summary {
  display: grid;
  gap: 6px;
  min-height: 112px;
  align-content: center;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

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

.mode-summary span {
  color: var(--muted);
}

.empty-state {
  min-height: 128px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px dashed rgba(33, 193, 97, 0.38);
  border-radius: var(--radius);
  color: var(--muted-strong);
  background:
    linear-gradient(135deg, rgba(33, 193, 97, 0.07), transparent 52%),
    rgba(255, 255, 255, 0.5);
  text-align: center;
}

.app-dialog {
  width: min(720px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.app-dialog::backdrop {
  background: rgba(10, 31, 23, 0.36);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.confirm-dialog {
  width: min(460px, calc(100vw - 32px));
}

.dialog-panel {
  display: grid;
  gap: 16px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 880;
  line-height: 1.25;
}

.dialog-close {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-actions.end {
  justify-content: flex-end;
}

.upload-field {
  position: relative;
}

.upload-field .file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.file-dropzone {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas:
    "mark title"
    "mark hint";
  align-items: center;
  column-gap: 12px;
  min-height: 88px;
  padding: 15px;
  border: 1px dashed rgba(33, 193, 97, 0.46);
  border-radius: var(--radius);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(33, 193, 97, 0.11), transparent 50%),
    rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: transform var(--ease), border-color var(--ease), background var(--ease), box-shadow var(--ease);
}

.file-dropzone:hover,
.upload-field .file-input:focus-visible + .file-dropzone {
  border-color: rgba(33, 193, 97, 0.72);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--ring);
  transform: translateY(-1px);
}

.upload-field .file-input:disabled + .file-dropzone {
  border-color: rgba(114, 140, 128, 0.28);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.58;
  pointer-events: none;
  transform: none;
}

.file-dropzone-mark {
  position: relative;
  grid-area: mark;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(33, 193, 97, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.file-dropzone-mark::before,
.file-dropzone-mark::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-strong);
  content: "";
  transform: translate(-50%, -50%);
}

.file-dropzone-mark::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.file-dropzone strong {
  grid-area: title;
  font-size: 15px;
}

.file-dropzone small {
  grid-area: hint;
  color: var(--muted);
  font-size: 12px;
}

.confirm-copy {
  margin: 0;
  color: var(--muted-strong);
}

.confirm-address {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(33, 193, 97, 0.24);
  border-radius: 6px;
  color: var(--brand-deep);
  background: rgba(218, 250, 230, 0.72);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 32px));
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--ease), transform var(--ease);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: minmax(220px, auto) minmax(240px, 1fr) auto;
  }

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

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

@media (max-width: 980px) {
  .material-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.82fr);
  }

  .material-preview,
  .material-attachment {
    grid-column: 1 / -1;
  }

  .material-card .card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  :root {
    --header-height: 68px;
  }

  body {
    font-size: 16px;
  }

  .app-shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    padding: 12px;
  }

  .site-header {
    top: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    min-height: var(--header-height);
    padding: 10px;
  }

  .brand {
    gap: 9px;
  }

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

  .brand h1 {
    max-width: 36vw;
    font-size: 15px;
  }

  .brand p {
    font-size: 11px;
  }

  .desktop-nav,
  .header-wallet .chain-badge,
  .header-wallet .eyebrow,
  .header-wallet .wallet-address {
    display: none;
  }

  .header-wallet {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header-wallet .primary-button {
    min-height: 44px;
    max-width: 34vw;
    padding: 0 10px;
    white-space: nowrap;
  }

  .menu-button {
    display: grid;
  }

  .workspace {
    padding: 18px 0 22px;
  }

  .command-center {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "metrics";
    min-height: auto;
    padding: 18px;
  }

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

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

  .mobile-scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    background: rgba(10, 31, 23, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ease);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  .mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(84vw, 380px);
    padding: 14px;
    border-left: 1px solid var(--glass-line);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 253, 249, 0.76)),
      rgba(255, 255, 255, 0.78);
    box-shadow: -24px 0 70px rgba(16, 50, 34, 0.2);
    transform: translateX(104%);
    transition: transform 220ms ease;
    backdrop-filter: blur(26px) saturate(150%);
    -webkit-backdrop-filter: blur(26px) saturate(150%);
  }

  body.mobile-menu-open .mobile-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-menu-open .mobile-drawer {
    transform: translateX(0);
  }

  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 50px;
  }

  .compact-brand {
    min-width: 0;
  }

  .drawer-close {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1;
  }

  .drawer-nav {
    display: grid;
    width: 100%;
  }

  .drawer-nav .tab-button {
    width: 100%;
    min-height: 46px;
    padding: 0 10px;
  }

  .view-head {
    gap: 12px;
  }

  .tool-actions {
    width: 100%;
  }

  .tool-actions .primary-button,
  .tool-actions .secondary-button {
    flex: 1 1 140px;
  }

  .material-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    min-height: auto;
    padding: 14px;
  }

  .material-preview,
  .material-attachment,
  .material-card .card-actions {
    grid-column: auto;
  }

  .material-card .card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .material-card .icon-button,
  .material-card .danger-icon {
    min-height: 44px;
    flex: 1 1 84px;
  }

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

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

@media (max-width: 640px) {
  .command-copy h2 {
    font-size: 28px;
  }

  .view-head,
  .form-actions,
  .file-meta-row,
  .order-item {
    align-items: stretch;
    flex-direction: column;
  }

  .view-head {
    display: grid;
  }

  .metric-grid {
    gap: 10px;
  }

  .metric-card {
    min-height: 92px;
    padding: 14px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .material-list-panel,
  .settings-panel,
  .billing-panel,
  .order-panel {
    padding: 14px;
  }

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

  .order-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .order-actions {
    justify-content: flex-start;
  }

  .app-dialog {
    width: min(100vw - 20px, 720px);
    max-height: calc(100dvh - 20px);
  }

  .dialog-panel {
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions .button-row,
  .dialog-actions.end {
    width: 100%;
  }

  .dialog-actions.end .secondary-button,
  .dialog-actions.end .danger-button,
  .button-row .primary-button,
  .button-row .secondary-button,
  .order-actions .primary-button,
  .order-actions .secondary-button,
  .order-actions .small-button {
    flex: 1 1 auto;
  }

  .file-dropzone {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mark"
      "title"
      "hint";
    justify-items: start;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding: 10px;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .brand {
    gap: 8px;
  }

  .brand h1 {
    max-width: 24vw;
    font-size: 14px;
  }

  .brand p {
    display: none;
  }

  .header-wallet .primary-button {
    max-width: 30vw;
    padding: 0 8px;
    font-size: 12px;
  }

  .mobile-drawer {
    width: 86vw;
    padding: 12px;
  }

  .drawer-nav .tab-button {
    min-height: 44px;
    font-size: 14px;
  }
}
