body {
  background: #f3f4f6;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  background: #005bff;
  padding: 8px 20px;
}
.topbar a {
  color: #fff;
  opacity: .85;
  font-size: 13px;
  text-decoration: none;
}

.mart-header {
  background: #005bff;
  color: #fff;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px 26px;
}
.mart-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
}
.mart-header p {
  margin: 0;
  color: rgba(255, 255, 255, .78);
}
.mart-seller {
  display: grid;
  gap: 6px;
  min-width: 220px;
  font-size: 13px;
}
.mart-seller select,
.mart-upload input {
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
}

.mart-main {
  max-width: 1240px;
  margin: 20px auto 40px;
  padding: 0 20px;
  display: grid;
  gap: 16px;
}
.mart-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
  padding: 16px;
}
.mart-upload form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.mart-upload label {
  display: grid;
  gap: 6px;
  min-width: min(420px, 100%);
  font-size: 13px;
  color: #374151;
}
.mart-status {
  margin-top: 10px;
  color: #4b5563;
  white-space: pre-line;
}
.mart-status.is-ok { color: #166534; }
.mart-status.is-error { color: #991b1b; }

.mart-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}
.mart-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mart-section-head h2 {
  margin: 0;
  font-size: 17px;
}
.portfolio-total {
  font-weight: 700;
  color: #166534;
}

.period-list {
  display: grid;
  gap: 8px;
}
.period-button {
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 6px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}
.period-button:hover,
.period-button.is-active {
  border-color: #005bff;
  background: #eff6ff;
}
.period-button strong {
  display: block;
  margin-bottom: 3px;
}
.period-button span {
  display: block;
  color: #6b7280;
  font-size: 12px;
}
.period-button small {
  display: block;
  margin-top: 3px;
  color: #9ca3af;
  font-size: 11px;
}

.table-wrap {
  overflow: auto;
}
.mart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mart-table th,
.mart-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 9px 8px;
  text-align: right;
  white-space: nowrap;
}
.mart-table th:first-child,
.mart-table td:first-child {
  text-align: left;
}
.mart-table th {
  color: #6b7280;
  font-weight: 700;
}
.profit-good { color: #166534; font-weight: 700; }
.profit-bad { color: #b91c1c; font-weight: 700; }

.change-log {
  display: grid;
  gap: 8px;
}
.change-item {
  display: grid;
  grid-template-columns: 110px 110px 1fr;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  padding: 8px 0;
  font-size: 13px;
}
.change-item strong {
  color: #111827;
}
.change-item span {
  color: #6b7280;
}

@media (max-width: 860px) {
  .mart-header,
  .mart-layout {
    grid-template-columns: 1fr;
    display: grid;
  }
  .mart-header {
    align-items: start;
  }
  .change-item {
    grid-template-columns: 1fr;
  }
}
