main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
}

section {
  margin-bottom: 24px;
}

h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-fg-default);
  margin-bottom: 12px;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.repo-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s;
}

.repo-card:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.repo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.repo-icon {
  color: var(--color-fg-muted);
  flex-shrink: 0;
}

.repo-name {
  color: var(--color-accent);
  font-weight: 600;
  flex: 1;
}

.badge {
  font-size: 12px;
  padding: 0 7px;
  border: 1px solid var(--color-border-default);
  border-radius: 2em;
  background: var(--color-canvas-subtle);
  color: var(--color-accent);
  font-weight: 500;
}

.repo-desc {
  color: var(--color-fg-muted);
  font-size: 12px;
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}

.repo-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--color-fg-muted);
  margin-top: auto;
}

.lang {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-fg-subtle);
}

.lang-ruby .lang-dot { background: #701516; }
.lang-go .lang-dot { background: #00ADD8; }
.lang-rust .lang-dot { background: #dea584; }
.lang-javascript .lang-dot { background: #f1e05a; }
.lang-typescript .lang-dot { background: #3178c6; }
.lang-python .lang-dot { background: #3572A5; }
.lang-shell .lang-dot { background: #89e051; }
.lang-html .lang-dot { background: #e34c26; }
.lang-css .lang-dot { background: #563d7c; }
.lang-c .lang-dot { background: #555555; }
.lang-csharp .lang-dot { background: #178600; }
.lang-swift .lang-dot { background: #F05138; }

.contributions {
  margin-bottom: 24px;
}

.contributions .contrib-wrapper {
  display: flex;
  gap: 16px;
}

.year-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  font-size: 12px;
  max-height: 130px;
  overflow-y: auto;
}

.year-selector button {
  background: none;
  border: none;
  color: var(--color-fg-muted);
  cursor: pointer;
  padding: 4px 12px;
  text-align: left;
  border-radius: 4px;
  font-size: 12px;
}

.year-selector button:hover {
  color: var(--color-fg-default);
}

.year-selector button.active {
  background: var(--color-accent);
  color: #fff;
}

@media (max-width: 768px) {
  .contributions .contrib-wrapper {
    flex-direction: column;
  }
  .year-selector {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }
}

#contrib-graph {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: 6px;
  overflow-x: auto;
}

.contrib-months {
  display: grid;
  grid-auto-columns: 10px;
  gap: 3px;
  font-size: 10px;
  color: var(--color-fg-muted);
  margin-left: 32px;
  height: 15px;
}

.contrib-container {
  display: flex;
}

.contrib-days {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  color: var(--color-fg-muted);
  width: 32px;
  flex-shrink: 0;
}

.contrib-days span {
  height: 10px;
  line-height: 10px;
}

.contrib-grid {
  display: grid;
  gap: 3px;
}

.contrib-week {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  gap: 3px;
}

.contrib-day {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  outline: 1px solid rgba(27, 31, 35, 0.06);
  outline-offset: -1px;
}

.contrib-empty { background: transparent; outline: none; }
.contrib-0 { background: #ebedf0; }
.contrib-1 { background: #9be9a8; }
.contrib-2 { background: #40c463; }
.contrib-3 { background: #30a14e; }
.contrib-4 { background: #216e39; }

@media (prefers-color-scheme: dark) {
  .contrib-day { outline: 1px solid rgba(255, 255, 255, 0.05); }
  .contrib-0 { background: #161b22; }
  .contrib-1 { background: #0e4429; }
  .contrib-2 { background: #006d32; }
  .contrib-3 { background: #26a641; }
  .contrib-4 { background: #39d353; }
}

.contrib-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--color-fg-muted);
  margin-top: 8px;
  padding-right: 16px;
}

.contrib-legend .contrib-day {
  outline: none;
}

#activity {
  margin-bottom: 24px;
}

#activity-feed {
  font-size: 14px;
}

.commit {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  align-items: baseline;
  border-bottom: 1px solid var(--color-border-default);
  flex-wrap: wrap;
}

.commit:last-child {
  border-bottom: none;
}

.commit-date {
  color: var(--color-fg-subtle);
  min-width: 130px;
  flex-shrink: 0;
  font-size: 12px;
}

.commit-repo {
  color: var(--color-accent);
  min-width: 180px;
  flex-shrink: 0;
  font-size: 12px;
}

.commit-message {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-fg-default);
  min-width: 200px;
}

@media (max-width: 600px) {
  .commit {
    flex-direction: column;
    gap: 4px;
  }
  .commit-date {
    min-width: auto;
    order: 2;
  }
  .commit-repo {
    min-width: auto;
    order: 1;
  }
  .commit-message {
    order: 0;
    white-space: normal;
    min-width: auto;
    font-weight: 500;
  }
}

.loading {
  color: var(--color-fg-muted);
  padding: 16px 0;
}

.all-repos h2 {
  margin-bottom: 12px;
}

.repo-group {
  margin-bottom: 16px;
}

.repo-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-fg-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border-default);
}

.repo-group-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .repo-group-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .repo-group-list {
    grid-template-columns: 1fr;
  }
}

.repo-link {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s;
}

.repo-link:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.repo-link-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.repo-link-name {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-link-desc {
  color: var(--color-fg-muted);
  font-size: 11px;
  line-height: 1.4;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.repo-link-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-fg-muted);
}

.repo-link-lang {
  display: flex;
  align-items: center;
  gap: 4px;
}

.repo-link-lang .lang-dot {
  width: 8px;
  height: 8px;
}
