:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #18201d;
  background: #f5f7f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

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

.app-shell {
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 247, 244, 0.94)),
    #f5f7f4;
}

.workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 28px;
  border-bottom: 1px solid #d8ded6;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  font-weight: 720;
  line-height: 1.1;
}

.topbar p {
  margin-top: 8px;
  color: #5a665f;
  font-size: 15px;
}

.status {
  min-width: 76px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background: #ffffff;
  color: #2d3b34;
  font-size: 13px;
  font-weight: 650;
}

.status[data-state="error"] {
  border-color: #d9a6a6;
  color: #842d2d;
}

.profile-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
}

.profile-toolbar label {
  display: grid;
  gap: 7px;
  width: min(520px, 100%);
}

.profile-toolbar label span {
  color: #5a665f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background: #ffffff;
  color: #18201d;
}

input {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background: #ffffff;
  color: #18201d;
}

textarea {
  width: 100%;
  min-height: 92px;
  padding: 9px 10px;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background: #ffffff;
  color: #18201d;
  resize: vertical;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background: #ffffff;
  color: #18201d;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  border-color: #98a59e;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.profile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #d8ded6;
  border-radius: 8px;
  background: #ffffff;
}

.profile-summary p,
.profile-summary code {
  margin-top: 8px;
  color: #5a665f;
  font-size: 13px;
}

.profile-summary code {
  overflow-wrap: anywhere;
}

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

article {
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid #d8ded6;
  border-radius: 8px;
  background: #ffffff;
}

article[data-state="pass"] {
  border-left: 4px solid #2f7d4f;
}

article[data-state="warn"] {
  border-left: 4px solid #b7781f;
}

article[data-state="fail"] {
  border-left: 4px solid #b13b3b;
}

h2 {
  font-size: 15px;
  font-weight: 720;
}

article p {
  margin-top: 10px;
  color: #5a665f;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

article span {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1ee;
  color: #2d3b34;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.error {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #d9a6a6;
  border-radius: 8px;
  background: #fff7f7;
  color: #842d2d;
}

.action-result {
  margin: 18px 0 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid #d8ded6;
  border-radius: 8px;
  background: #111815;
  color: #eef5ef;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.projects-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #d8ded6;
}

.onboarding-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #d8ded6;
}

.section-heading,
.project-card-main,
.project-card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading p {
  margin-top: 7px;
  color: #5a665f;
  font-size: 14px;
}

.project-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.project-actions:has(label + label) {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr) auto;
}

.project-actions label {
  display: grid;
  gap: 7px;
}

.project-actions label span {
  color: #5a665f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.setup-repo-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #d8ded6;
  border-radius: 8px;
  background: #ffffff;
}

.setup-repo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr) minmax(260px, 0.8fr);
  gap: 12px;
  margin-top: 14px;
}

.setup-repo-grid label {
  display: grid;
  gap: 7px;
}

.setup-repo-grid label span,
.setup-repo-controls label span {
  color: #5a665f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.setup-repo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.setup-repo-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.setup-repo-controls input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.empty-state {
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed #b9c4bd;
  border-radius: 8px;
  background: #ffffff;
}

.empty-state p {
  margin-top: 8px;
  color: #5a665f;
  font-size: 14px;
}

.project-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.project-card {
  min-height: auto;
  display: grid;
  gap: 12px;
}

.project-card[data-state="dirty"] {
  border-left: 4px solid #346eb8;
}

.project-card-main h2 {
  overflow-wrap: anywhere;
}

.project-card-main p,
.project-card > p {
  margin-top: 8px;
  color: #5a665f;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta span,
.project-card-main > span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1ee;
  color: #2d3b34;
  font-size: 12px;
  font-weight: 750;
}

.project-warning {
  color: #8a570f !important;
}

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

.detected-accounts {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.onboarding-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d8ded6;
  border-radius: 8px;
  background: #ffffff;
}

.onboarding-summary div {
  display: grid;
  gap: 5px;
}

.onboarding-summary strong {
  font-size: 13px;
}

.onboarding-summary span {
  color: #5a665f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-card {
  min-height: auto;
  display: grid;
  gap: 12px;
}

.account-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.account-main p,
.account-card p,
.account-card code {
  margin-top: 8px;
  color: #5a665f;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.account-main > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1ee;
  color: #2d3b34;
  font-size: 12px;
  font-weight: 750;
}

.manual-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.manual-profile label {
  display: grid;
  gap: 7px;
}

.manual-profile label span {
  color: #5a665f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.repo-detail-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #d8ded6;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.detail-summary span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d8ded6;
  color: #2d3b34;
  font-size: 12px;
  font-weight: 750;
}

.repo-actions-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #d8ded6;
  border-radius: 8px;
  background: #ffffff;
}

.repo-action-buttons,
.repo-action-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.repo-action-form label {
  display: grid;
  gap: 7px;
  flex: 1 1 260px;
}

.repo-action-form label span {
  color: #5a665f;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.detail-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d8ded6;
  border-radius: 8px;
  background: #ffffff;
}

.detail-block h2 {
  margin-bottom: 12px;
}

.detail-block p {
  color: #5a665f;
  font-size: 13px;
  line-height: 1.45;
}

.pending-block {
  margin-top: 12px;
}

.file-list,
.compact-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.file-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.file-row span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #edf1ee;
  color: #2d3b34;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.file-row code,
.compact-list code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #4f5d55;
  font-size: 12px;
}

.compact-list > div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #edf1ee;
  border-radius: 8px;
  background: #fbfcfb;
}

.compact-list strong {
  color: #18201d;
  font-size: 13px;
}

.compact-list span {
  color: #5a665f;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

  .profile-toolbar,
  .profile-summary,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .project-actions,
  .project-actions:has(label + label),
  .setup-repo-grid,
  .manual-profile {
    grid-template-columns: 1fr;
  }

  .setup-repo-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .onboarding-summary {
    align-items: stretch;
    flex-direction: column;
  }

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

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

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

  .topbar {
    flex-direction: column;
  }

  .profile-actions {
    justify-content: stretch;
  }

  .profile-actions button {
    flex: 1 1 160px;
  }
}
