
.company-section {
  padding: 1rem 0;
}

.company-section h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 0 0.5rem 0;
  border-bottom: 1px solid var(--brand-color-lighter);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.company-section-content {
  padding: 0.75em;
  border: 1px solid var(--brand-color-lighter);
  border-radius: 0.5rem;
  background: var(--brand-color-darker);
  display: flex;
}

.company-section-left {
  width: 25%;
}

.company-section-right {
  margin-left: auto;
}

.company-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
}

.company-detail + .company-detail {
  border-top: 1px solid var(--brand-color-mid);
}

.company-detail-label {
  color: var(--text-soft);
  min-width: 5em;
}

.company-detail-value {
  color: var(--text);
}

.company-region {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.1em 0.4em;
  border-radius: 0.25rem;
  background: var(--brand-color-mid);
  color: var(--text-soft);
  margin-right: 0.25rem;
}

.companies-empty {
  color: var(--text-soft);
  text-align: center;
  padding: 2rem 1rem;
}

.company-meta {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.companies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.5rem 0;
}

.companies-header h2 {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  min-width: 0;
}

.companies-header h2 .search-logo {
  flex-shrink: 0;
  margin-top: 0.15em;
}

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

.company-name-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-width: 0;
}

.company-name {
  min-width: 0;
}

.company-verified-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85em;
  height: 0.85em;
  flex: 0 0 auto;
  line-height: 1;
  vertical-align: middle;
}

.company-verified-check svg {
  display: block;
  width: 0.85em;
  height: 0.85em;
  flex: 0 0 auto;
}

.part-of-group {
  font-size: initial;
  font-weight: initial;
  margin-top: 2px;
  line-height: 1.2;
}

.company-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

.company-actions .danger-button {
  display: inline-block;
  margin: 0;
}

.company-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.company-list-item {
  padding: 0;
  border-radius: 0.75rem;
  overflow: hidden;
}

.company-list-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
  background: #ffffff03;
  transition: background 0.15s ease;
}

.company-list-card:hover {
  background: var(--brand-color-darker);
}

.company-list-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 0.75rem;
  min-width: 0;
}

.company-list-logo,
.company-list-logo-placeholder {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  border-radius: 0.5rem;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.company-list-logo-placeholder {
  background: var(--brand-color-mid);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.5rem;
}

.company-list-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.company-list-name {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-list-code {
  font-size: 0.8rem;
  color: var(--text-soft);
  font-family: monospace;
}

.company-list-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  white-space: nowrap;
  margin-top: auto;
}

.company-list-stats strong {
  color: var(--text);
  font-weight: 600;
}

/* Profile: Sandbox / Economy split layout */
.companies-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.companies-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--brand-color-lighter);
}

.companies-column-count {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--brand-color-mid);
  color: var(--text-soft);
  padding: 0.15em 0.5em;
  border-radius: 999px;
  min-width: 1.5em;
  text-align: center;
}

.companies-column .company-list {
  grid-template-columns: 1fr;
}

.companies-column .companies-empty {
  /* keep centered but inside column */
}

.companies-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0 0.25rem 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-soft);
}

.companies-subheader:first-of-type {
  margin-top: 0;
}

.companies-column .company-list + .companies-subheader {
  margin-top: 1.25rem;
}

/* Difficulty pill shown on economy cards */
.company-difficulty {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15em 0.45em;
  border-radius: 999px;
  margin-left: 0.5em;
  vertical-align: middle;
  white-space: nowrap;
}

.company-difficulty-sandbox { background: #6b7280; color: #fff; }
.company-difficulty-easy { background: #16a34a; color: #fff; }
.company-difficulty-medium { background: #ea580c; color: #fff; }
.company-difficulty-hard { background: #dc2626; color: #fff; }

@media (max-width: 850px) {
  .companies-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .company-list {
    display: block;
    border: 1px solid var(--brand-color-lighter);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--background);
  }

  .company-list-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .company-list-card:hover {
    background: var(--brand-color-darker);
  }

  .company-list-item + .company-list-item {
    border-top: 1px solid var(--brand-color-lighter);
  }

  .company-list-logo,
  .company-list-logo-placeholder {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
  }

  .company-list-logo-placeholder {
    font-size: 1rem;
  }

  .company-list-stats {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    margin-top: 0;
  }
}
