* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
}

a {
  color: #06c;
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
  background: #f5f5f7;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.28px;
}

.login-subtitle {
  margin: 0 0 40px;
  color: #86868b;
  font-size: 21px;
  line-height: 1.2;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #424245;
  background: #1d1d1f;
  color: #fff;
  font-size: 17px;
}

.login-help {
  margin: 16px 0 0;
  color: #86868b;
  font-size: 14px;
  letter-spacing: -0.224px;
}

.error-text {
  color: #ff3b30;
  font-size: 14px;
  letter-spacing: -0.224px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 48px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  align-items: center;
}

.topbar-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-title {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.224px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.topbar-button {
  color: #fff;
  font-size: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.88;
}

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.hero-title {
  margin: 0 0 10px;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.28px;
}

.hero-copy {
  max-width: 760px;
}

.hero-subtext {
  margin: 0;
  color: #6e6e73;
  font-size: 17px;
  line-height: 1.5;
}

.card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  padding: 24px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.24px;
}

.section-description {
  margin: 0;
  color: #86868b;
  font-size: 14px;
  line-height: 1.5;
}

.btn-primary {
  border: none;
  border-radius: 980px;
  background: #0071e3;
  color: #fff;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-text {
  border: none;
  background: none;
  color: #06c;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
}

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

.summary-card {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
  border: 1px solid #ececef;
}

.summary-label {
  color: #86868b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  margin-top: 10px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 24px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.24px;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #d2d2d7;
  background: #fbfbfd;
  font-size: 14px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 320px);
  overflow: auto;
}

.project-row {
  width: 100%;
  text-align: left;
  border: 1px solid #e5e5ea;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  cursor: pointer;
}

.project-row.active {
  border-color: #0071e3;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.22);
  background: #f4f8ff;
}

.project-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.project-brief {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}

.project-id {
  color: #86868b;
  font-size: 12px;
  font-family: ui-monospace, "SFMono-Regular", SFMono-Regular, Menlo, monospace;
}

.project-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  color: #6e6e73;
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-queued {
  background: #fff4d6;
  color: #8a5b00;
}

.status-running {
  background: #e8f1ff;
  color: #0057b8;
}

.status-succeeded {
  background: #e8f7ea;
  color: #1d7a36;
}

.status-failed {
  background: #fde8e8;
  color: #b3261e;
}

.status-other {
  background: #f0f0f2;
  color: #3a3a3c;
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-block {
  border: 1px solid #ececef;
  border-radius: 16px;
  padding: 18px;
  background: #fbfbfd;
}

.detail-block h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
}

.detail-empty {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #86868b;
  font-size: 15px;
}

.kv-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 14px;
  font-size: 14px;
}

.kv-key {
  color: #86868b;
}

.kv-value {
  word-break: break-word;
}

.code-block {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: #1d1d1f;
  color: #f5f5f7;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  font-family: ui-monospace, "SFMono-Regular", SFMono-Regular, Menlo, monospace;
}

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #f5f5f7 0%, #e9eef7 100%);
}

.loading-card-inner {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  padding: 28px 32px;
  text-align: center;
}

.loading-card-message {
  margin: 0;
  color: #1d1d1f;
  font-size: 17px;
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .project-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .topbar-inner,
  .content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-grid,
  .project-meta,
  .kv-grid {
    grid-template-columns: 1fr;
  }
}
