:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #17202a;
  --muted: #667085;
  --border: #d9e0e8;
  --accent: #0f766e;
  --accent-2: #b42318;
  --accent-soft: #e6f4f1;
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  border: 0;
}

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

.sidebar {
  background: #111827;
  color: #f8fafc;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-title {
  font-size: 15px;
  font-weight: 750;
}

.brand-subtitle {
  color: #b6c2d1;
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
}

.nav-button:hover,
.nav-button.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 760;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  min-width: 0;
}

.content {
  width: 100%;
  max-width: 1180px;
  padding: 24px 28px 44px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  min-height: 54px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 760;
}

.panel-body {
  padding: 18px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.form-grid > .full {
  grid-column: 1 / -1;
}

label {
  color: #344054;
  font-size: 12px;
  font-weight: 680;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  padding: 8px 10px;
  outline: none;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 680;
}

.btn.primary {
  color: white;
  background: var(--accent);
}

.btn.danger {
  color: white;
  background: var(--accent-2);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.market-list,
.item-list {
  display: grid;
  gap: 10px;
}

.market-item,
.list-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fff;
}

.list-row.compact {
  padding: 10px;
  gap: 6px;
}

.list-row.selectable {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.row-title {
  font-weight: 760;
  overflow-wrap: anywhere;
}

.row-meta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--surface-2);
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.status {
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
}

.status.error {
  color: #7a271a;
  background: #ffebe7;
}

.error-text {
  color: #7a271a;
  margin: 0;
}

.status.ok {
  color: #095c37;
  background: #e8f7ef;
}

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

.empty {
  min-height: 68px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
}

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

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

.metric-card,
.copy-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.metric-label,
.metric-hint {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.metric-hint {
  margin-top: 4px;
}

.copy-block {
  display: grid;
  gap: 8px;
}

.copy-block p {
  margin: 0;
  color: #344054;
  line-height: 1.5;
}

.share-public {
  min-height: 100vh;
  background: #f8fafc;
}

.public-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}

.public-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

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

.asset-tile {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.asset-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.asset-caption {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.asset-actions {
  display: flex;
  gap: 8px;
  padding: 0 10px 10px;
  flex-wrap: wrap;
}

.asset-actions .btn {
  min-height: 34px;
  padding: 0 10px;
}

.public-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.spacer-sm {
  height: 12px;
}

.spacer-md {
  height: 16px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid.two,
  .grid.three,
  .metric-grid,
  .metric-grid.small,
  .form-grid,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 16px;
  }

  .content,
  .public-content {
    padding: 16px;
  }
}
